libsession binding updates for payment reflow changes - #64
Open
jagerman wants to merge 6 commits into
Open
Conversation
Re-pin libsession -> 58bafc4a and fix the compile-breaking changes: - refund_requested_at removed from ProPaymentItem + ProStatusResponse (refund state is config-synced now) -> dropped from paymentItemToJs + parseProStatusResponse. - §4: dropped the removed sent_timestamp_ms arg from encode_for_community_inbox. - parseProProofResponse uses auto, so the ProProofResponse->GenerateProProofResponse rename is transparent (no change). Desktop is view-only, so there were no add_pro_payment/refund request builders to remove. Compiles against 58bafc4a (view-only glue; C++ LSP clean). REMAINING (functional): rotating-seed derivation (session_protocol_pro_rotating_seed) + UserProfile get/set_refund_requested, get/set_pro_prepaid, get_pro_renewal_target N-API — these pair with the desktop TS rework. WIP; not pushed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-pin libsession 58bafc4a -> a4809f7c (pro_features_for_utf8/16 ->
pro_features_for_message; UTFDecodingError status removed).
- proFeaturesForMessage now takes { codepointCount } instead of { utf16 }:
desktop counts codepoints natively ([...text].length) and libsession
owns the count -> feature policy. Drops the echoed codepointCount output.
- Remove the utf16Count / utf16CountTruncatedToCodepoints glue methods
(and TS decls): desktop counts/truncates natively now.
- Expose MESSAGE_CHARACTER_LIMIT_STANDARD / _PRO constants so desktop
single-sources the limits instead of hard-coding them.
Functional half of the reflow (pairs with the desktop TS rework):
- deriveProRotatingKey({ proMasterKeyHex, nowMs }): deterministic weekly
rotating seed + its ed25519 keypair via ProProof::rotating_seed, so every
device converges on the same key instead of hand-rolling/never-rotating.
- get/setRefundRequested (config key R), get/setProPrepaid (config key I),
getProRenewalTarget(nowMs): the config-synced refund + purchase-in-flight
markers and the renewal-target poll that replaces bespoke auto-renew logic.
- Drop the now-stale refundRequestedTsMs from the pro.d.ts response/payment
types (the C++ side stopped emitting it in the reflow re-pin).
Clients must not care about or assert libsession's rotating-seed rotation window (it's libsession-owned and may change). Reword the rotating-key comments to just 'the seed for now' instead of 'weekly'/'rotation period'; no code logic relied on the window.
…ponse libsession a4809f7c -> 078c611b (gated pro_renewal_target + advisory account_expiry_ts on generate_pro_proof). Surface the new field as accountExpiryMs on GenerateProProofResponse so the client can refresh its cached access expiry (E) in the same write as the new proof (and on a subscription_expired failure). Advisory/unsigned — display + E only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Glue changes backing the Desktop Pro redemption reflow (See PRs session-foundation/session-pro-backend#4 and session-foundation/libsession-util#104)
Re-pins the
libsession-utilsubmodule to078c611band exposes what the client needs:the advisory account expiry on the generate-proof response, deterministic rotating-seed
derivation, and user-config accessors for the pending-purchase and refund-pending flags
plus the cached account expiry. Character-limit counting now takes a codepoint count, with
the limit constants sourced here. The removed
add_pro_paymentpath is dropped, sinceredemption is implicit via generate_pro_proof.