Closed NeedleInAJayStack closed 3 months ago
This behavior appears to have been introduced in v1.18.0. Interestingly, by watching SQL logs it appears that version also changed addListener
to call LISTEN
automatically, so some of the notification tests are calling LISTEN
twice.
This behavior appears to have been introduced in v1.18.0. Interestingly, by watching SQL logs it appears that version also changed
addListener
to callLISTEN
automatically, so some of the notification tests are callingLISTEN
twice.
@NeedleInAJayStack Does this mean you actually used the old LISTEN
API?
Does this mean you actually used the old LISTEN API?
Yeah, we were using the old LISTEN API. However, my comment was more related to these tests, and specifically that the lines with conn?.simpleQuery("LISTEN example").wait()
are technically no longer needed since addListener
now calls LISTEN example;
. When watching the SQL logs I could see two LISTEN example
queries in a row.
I'm able to recreate the TinyFastSequenceTests.testReserveCapacityIsForwarded
CI failures in a swift:5.10-jammy
container locally:
/repo/Tests/ConnectionPoolModuleTests/TinyFastSequenceTests.swift:37: error: TinyFastSequenceTests.testReserveCapacityIsForwarded : XCTAssertEqual failed: ("9") is not equal to ("8") -
/repo/Tests/ConnectionPoolModuleTests/TinyFastSequenceTests.swift:46: error: TinyFastSequenceTests.testReserveCapacityIsForwarded : XCTAssertEqual failed: ("9") is not equal to ("8") -
/repo/Tests/ConnectionPoolModuleTests/TinyFastSequenceTests.swift:53: error: TinyFastSequenceTests.testReserveCapacityIsForwarded : XCTAssertEqual failed: ("9") is not equal to ("8") -
I'm able to recreate these errors on main
, and going back to v1.19.0 where these tests were introduced. I'm not sure why the CI passed on previous MRs though. Do you guys have any idea what might be different now compared with those other MRs?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 61.73%. Comparing base (
8f8724e
) to head (12c5d5d
).
This adjusts the SQL
LISTEN
statement called byPostgresConnection.addListener
to quote the channel name.For example, previously
addListener("abc")
would runLISTEN abc;
and it will now runLISTEN "abc";
As far as I can tell, this only matters when the channel name is a reserved Postgres keyword, like
default
.