Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
synapse-dev | 7fdc04d | Commit Preview URL Branch Preview URL |
Feb 25 2026, 11:59 AM |
| const permission = getPermissionFromTypeHash(hash) | ||
| this.expirations[permission] = event.args.expiry | ||
| } | ||
| this.emit('expirationsUpdated', this.#expirations) |
There was a problem hiding this comment.
and if it fails and doesn't even get here?
There was a problem hiding this comment.
What do you mean? it will throw an error. User still gets the connected event if syncExpirations doesnt fail.
There was a problem hiding this comment.
I mean watchContractEvent, not a big deal but this is lost here: https://v1.viem.sh/docs/contract/watchContractEvent.html#onerror-optional
|
This might be a good opportunity to deal with Perhaps:
Not a blocker, but the current session key code gives the impression this is all canonical and a closed set of permissions. But developers should be able to use the registry to do non-FWSS things and having an SDK that makes that easy would be nice. |
|
Will I be able to pass |
Yeah not sure yet, because session keys only works for those 4 mutations (maybe just 3 if delete dataset is gone), some of the other services do other mutations that need the root client. I think for now I'm just adding a new constructor option to pass a session keys and internally use if available and has permission. There's one subtle thing in this design, that I want your opinion. The connect/disconnect are actually optional, they are there if you want realtime tracking of the permissions, if you don't you can just pass whatever expirations you got from login and YOLO the mutations. I will be cleaning up with your comments and finish testing hopefully sps work today. |
Pass to where? I don't think we care in any of the places we use it, so this isn't an internal concern. I think the answer here is to just document how expirations work and for long-lived session key instances advise that the developer should be sure to refresh expiries occasionally to be sure to perform |
to but if you want to track expirations and get events to logout user or something you can. |
aa80d34 to
59913f0
Compare
59913f0 to
20c8483
Compare
b63ee2f to
8ba72b0
Compare
rvagg
left a comment
There was a problem hiding this comment.
With some suggestions, and some slightly more firm requests which are probably: missing onError handling, unless you want to defend not doing that? The Synapse.create could do with some attention while you're at it. I also wouldn't mind hearing more justification on connect() / disconnect() being in core and not a react specialty (I'm imagining "there are other long-running uses out there" .. but .. really, it's pretty much only going to be React right?).
I'm going to follow up with a docs PR to this.
…d improve logging
Example usage: