Skip to content

feat: initial cstoken support#1102

Open
gusquadri wants to merge 7 commits intotulir:mainfrom
gusquadri:cstoken-support
Open

feat: initial cstoken support#1102
gusquadri wants to merge 7 commits intotulir:mainfrom
gusquadri:cstoken-support

Conversation

@gusquadri
Copy link
Copy Markdown
Contributor

Introduce the initial implementation of cstokens, which currently appears to be in a very early stage in WA Web, as the feature flag is usually disabled in my tests.

It should receive the server-side nctsalt to generate cstokens (only through history sync and app sync events), and should only be generated when the tctoken is missing and the salt exists (as a fallback).

Initial question for Tulir:

  • Should we introduce an in-memory cache for these salts, or should we just store them in the database?

@purpshell
Copy link
Copy Markdown
Contributor

  • Should we introduce an in-memory cache for these salts, or should we just store them in the database?

I think these salts need to be stored inside the Store since it seems like WA doesn't regularly keep them updated per session. They can be loaded into memory during Connection to reduce DB overhead though.

Comment thread store/sqlstore/store.go
Comment thread store/sqlstore/upgrades/14-nct-salt.sql Outdated
Comment thread appstate.go Outdated
Comment thread appstate.go Outdated
Comment thread cstoken.go Outdated
Comment thread appstate.go Outdated
@gusquadri gusquadri requested a review from tulir April 28, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants