You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make integration test subscription behaviour consistent with JS tests
Make sure that we perform the subscription synchronously so as not to
miss events. This is a nuance that I missed when looking at Cursor's
generated code in fa255c1.
The way in which I've chosen to do this is not particularly elegant (and
to be honest Swift doesn't make it very easy to do so) but I think that
it's the closest to the JS code, which hopefully will mean Cursor will
be able to easily apply this pattern when translating further JS tests.
// I added this @MainActor as an "I don't understand what's going on there; let's try this" when observing that for some reason the setter of setListenerAfterProcessingIncomingMessage was hanging inside `-[ARTSRDelegateController dispatchQueue]`. This seems to avoid it and I have not investigated more deeply 🤷
asyncletcounterSubPromise:Void=withCheckedThrowingContinuation{ continuation in
655
-
do{
656
-
try #require(root.get(key:"counter")?.liveCounterValue).subscribe{ update, _ in
657
-
#expect(update.amount ==-1,"Check counter subscription callback is called with an expected update object after OBJECT_SYNC sequence with \"tombstone=true\"")
#expect(update.amount ==-1,"Check counter subscription callback is called with an expected update object after OBJECT_SYNC sequence with \"tombstone=true\"")
647
+
}()
664
648
665
649
// inject an OBJECT_SYNC message where a counter is now tombstoned
0 commit comments