mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-10 10:05:09 +03:00
Merge pull request #5805 from urbit/lf/http-api-improvement
@urbit/http-api: surface mark of updates
This commit is contained in:
commit
e37ac116a4
@ -273,7 +273,7 @@ export class Urbit {
|
||||
) {
|
||||
const funcs = this.outstandingSubscriptions.get(data.id);
|
||||
try {
|
||||
funcs.event(data.json);
|
||||
funcs.event(data.json, data.mark ?? 'json');
|
||||
} catch (e) {
|
||||
console.error('Failed to call subscription event callback', e);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ export interface SubscriptionInterface {
|
||||
/**
|
||||
* Handle %fact
|
||||
*/
|
||||
event?(data: any): void;
|
||||
event?(data: any, mark: string): void;
|
||||
/**
|
||||
* Handle %kick
|
||||
*/
|
||||
|
@ -131,8 +131,8 @@ describe('subscription', () => {
|
||||
await wait(600);
|
||||
|
||||
expect(airlock.onOpen).toBeCalled();
|
||||
expect(params.event).toHaveBeenNthCalledWith(1, firstEv);
|
||||
expect(params.event).toHaveBeenNthCalledWith(2, secondEv);
|
||||
expect(params.event).toHaveBeenNthCalledWith(1, firstEv, 'json');
|
||||
expect(params.event).toHaveBeenNthCalledWith(2, secondEv, 'json');
|
||||
}, 800);
|
||||
it('should poke', async () => {
|
||||
fetchSpy = jest.spyOn(window, 'fetch');
|
||||
|
Loading…
Reference in New Issue
Block a user