question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bookmarks in query streams, with offset argument to websocket endpoints

See original GitHub issue

Starting at the end of non-live data (#4461) we will include a "offset" as discussed in #3878. This will incompatibly change the liveness marker from {"live": true} to the first occurrence of an offset: {"events": [...], "offset": ...}, where [...] may be empty.

As implied by the above, not every response block will include an offset. We only promise to provide offsets once we reach the end of non-live data. In fact, we promise not to provide offsets until we reach the end of non-live data.

The current query union format is {templateIds, query} | [{templateIds, query}...], and fetch by key format is [{templateId, key}]; @hurryabit to determine where the nicest place to put offset is in these datatypes, noting that we can only reasonably have one offset for all queries in the union. The behavior of specifying a non-existent offset will be passed through from ledger API.

The only intended effect of this change is to make streams reconnect-able; the remaining stream semantics will not change.

This will disable “phantom archive” filtering entirely for resumed contract key streams, while it will remain in place for fetch streams for which offset is not supplied. Refining this behavior should be addressed in a separate issue, as @gerolf-da has noted various complicating factors.

Depends on #4465.

cc @dtanabe @lima-da

  • how to pass offset, especially in case of [union...]?
  • how to represent LedgerBegin? null

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
leo-dacommented, Feb 18, 2020

@S11001001 how about

{events: [...], live: false, offset=<last event offset>}
{events: [...], live: true,  offset=<last event offset>}
{events: [...], live: true,  offset=<last event offset>}
1reaction
lima-dacommented, Feb 20, 2020

ok, then I am fine with it if we can strictly define that only -> {offset: 1} -> [query1, query2,…] <- {“events”: …} or -> [query1, query2,…] <- {“events”: …} would work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Woe be unto you for using a WebSocket - Hacker News
A stream isn't "one request, one response" but you can still write your websocket endpoints to be stateless. Once you realize that, its...
Read more >
Remote Control API WebSocket Reference for Unreal Engine
Remote Control API WebSocket Reference. Details about the WebSocket endpoints offered by the Remote Control API for controlling the engine remotely.
Read more >
Streaming Updates - Redux Toolkit
RTK Query gives you the ability to receive streaming updates for persistent queries. This enables a query to establish an ongoing connection to ......
Read more >
Release notes — DAML SDK 1.4.0-snapshot.20200722.4800.0.21 ...
The JSON API Server exposes several Websocket endpoints which allow clients to maintain a live view of contract data without polling. These endpoints...
Read more >
TrueNAS Websocket Documentation
Client connects to websocket endpoint and sends a connect message. ... dns_timeout timeout value for DNS queries during the initial domain join.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found