Skip to content

libsession binding updates for payment reflow changes - #64

Open
jagerman wants to merge 6 commits into
session-foundation:mainfrom
jagerman:pro-redemption-reflow
Open

libsession binding updates for payment reflow changes#64
jagerman wants to merge 6 commits into
session-foundation:mainfrom
jagerman:pro-redemption-reflow

Conversation

@jagerman

Copy link
Copy Markdown
Member

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-util submodule to 078c611b and 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_payment path is dropped, since
redemption is implicit via generate_pro_proof.

jagerman and others added 6 commits July 29, 2026 19:18
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.
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.

1 participant