mirror of
https://github.com/urbit/shrub.git
synced 2025-01-08 06:00:27 +03:00
Merge pull request #3799 from urbit/m/silent-subs
eyre: ignore facts directly after clog
This commit is contained in:
commit
ca3872fba4
@ -1500,6 +1500,14 @@
|
||||
?~ channel
|
||||
:_ state :_ ~
|
||||
[duct %pass /flog %d %flog %crud %eyre-no-channel >id=channel-id< ~]
|
||||
:: it's possible that this is a fact emitted directly alongside a fact
|
||||
:: that triggered a clog & closed the subscription. in that case, just
|
||||
:: drop the fact.
|
||||
::
|
||||
?: ?& ?=(%fact -.sign)
|
||||
!(~(has by subscriptions.u.channel) request-id)
|
||||
==
|
||||
[~ state]
|
||||
:: attempt to convert the sign to json.
|
||||
:: if conversion succeeds, we *can* send it. if the client is actually
|
||||
:: connected, we *will* send it immediately.
|
||||
|
@ -1875,7 +1875,7 @@
|
||||
loop-fact(cur +(cur))
|
||||
:: the next subscription result should trigger a clog
|
||||
::
|
||||
=^ results eyre-gate
|
||||
=^ results1 eyre-gate
|
||||
%: eyre-take
|
||||
eyre-gate
|
||||
now
|
||||
@ -1922,7 +1922,25 @@
|
||||
==
|
||||
==
|
||||
==
|
||||
results
|
||||
:: subsequent subscription updates, which might have gotten sent out during
|
||||
:: the same event in which a clog triggered, should be silently ignored
|
||||
::
|
||||
=^ results2 eyre-gate
|
||||
%: eyre-take
|
||||
eyre-gate
|
||||
now
|
||||
scry=scry-provides-code
|
||||
^= take-args
|
||||
:* wire=/channel/subscription/'0123456789abcdef'/'1'/~nul/two
|
||||
duct=~[/http-put-request]
|
||||
^- (hypo sign:eyre-gate)
|
||||
:- *type
|
||||
[%g %unto %fact %json !>(`json`[%a [%n '1'] ~])]
|
||||
==
|
||||
^= moves
|
||||
~
|
||||
==
|
||||
(weld results1 results2)
|
||||
::
|
||||
++ test-born-sends-pending-cancels
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user