Commit Graph
6831 Commits
Author SHA1 Message Date
spaced4ndy 1bbbad99cb core, badge-service, ios, android: change badge tier in the store, and restore a subscription on another device (#7795) 2026-10-21 16:53:15 +00:00
spaced4ndy f8f64a3047 core, ios, android: explain a failed badge renewal and stop retrying a subscription the store forgot; tests (#7788) 2026-10-21 07:44:20 +00:00
spaced4ndy 6cef6b9e60 badge-service: name the purchase each request came from in the log 2026-10-20 20:32:04 +04:00
spaced4ndy 696abf13ab badge-service: name the purchase each request came from in the log 2026-10-20 20:19:01 +04:00
spaced4ndy b6376b90c7 fix compilation 2026-10-20 19:26:06 +04:00
spaced4ndy a68eb91da1 badge-service: log each request's command and each store check's outcome 2026-10-20 19:16:36 +04:00
spaced4ndy ccf136ca13 core: let a dev build ask the badge service on an interval 2026-10-20 19:03:53 +04:00
spaced4ndy 3c61a3ced4 badge-service: credit test purchases and check the store during coverage in a dev deployment 2026-10-20 18:50:52 +04:00
spaced4ndy 5fd0b5e7fd docs: bound a badge move by the previous credential's expiry 2026-10-20 17:15:48 +04:00
spacedandy-agents-simplex 038f50ac30 core, ios, android, desktop: let a lapsed iOS subscriber subscribe again to the badge the profile retired
The iOS app refused any subscription to an Apple ID that ever subscribed, so a lapsed subscriber could never subscribe again in the app. Core now tells the apps each subscription's store reference (BadgeSubscription.transactionRef, optional in JSON), and the iOS gate opens a subscription card only when every earlier subscription of the Apple ID is the active profile's newest purchase, retired, of the card's badge: the one charge core resumes. Kotlin gets the model field only, as Play gives a resubscription a new token and needs no gate.

Run: 011-subscription-resume, slice S2b
2026-10-20 16:33:12 +04:00
spacedandy-agents-simplex 1d72c4c2e7 fixup! core: resume a retired Apple subscription when its store charges it again
Review round 1 fixes:
- R1-1: a resumable charge waiting behind another held receipt of the owner is answered held and left unfinished, rather than answered from the record and finished uncredited.
- R1-3: a resume shows the purchase again only with a credential that has not expired.
- R1-2, R1-8: tests of the resumable-charge rule and the hold's edge, of a held charge whose paid period ends before it is sent, and that a resumed profile shows the newest credential. The resume test is split in two, one environment each.
- R2-V1: a test comment that the reordered steps made false.

Run: 011-subscription-resume, review rounds 1 and 2
2026-10-20 16:33:12 +04:00
spacedandy-agents-simplex 6a00c55c7a core: resume a retired Apple subscription when its store charges it again
A same-install resubscription keeps Apple's original transaction id, so its hand-over found the old credited record and was answered from it with the old credential: the subscriber paid and got nothing. A credited record is now held again when a later charge of its subscription is handed over, the charge is not revoked, its paid period runs and it is dated less than a day ahead of this device's clock, and the record's purchase is its owner's newest, a subscription and not shown, with no other receipt held. The receipt worker then sends the purchase's issueBadge, and the service grants the charge as a renewal. A covered answer shows the purchase again with the newest credential and clears an ended state. A charge the service answers without crediting is deferred an hour and refused a day after its purchase date, so it holds the profile for about a day. A refused resume is remembered on the record (every credit, re-hold and resume clears credit_error), so the app's sweep does not hold the same charge again after its day.

Run: 011-subscription-resume, slice S2a
2026-10-20 16:33:12 +04:00
spacedandy-agents-simplex ed3e236fe9 core: retire on a device's ended report only once the paid period is over
StoreKit can report a subscription expired during Apple's billing retry, and Apple may then recover the charge, so retiring at once on that report left a paying user without the badge. The service's answered ended still retires at once, also while the ledger covers. A stored ended, which is how the device's report arrives, retires once paidThrough has passed.

Run: 011-subscription-resume, slice S1c
2026-10-20 16:33:09 +04:00
spacedandy-agents-simplex 5e642d49a3 core: split the badge request's lock from its body
The receipt worker's attempt already holds the owner's badge lock, which is not reentrant, so it cannot call requestBadgeIssue. The body becomes sendBadgeIssue, and both answer a service error as Left (code, retryAfter) instead of Nothing, so that caller can classify it as it does today. No behaviour change.

Run: 011-subscription-resume, slice S2-0
2026-10-20 15:38:12 +04:00
spacedandy-agents-simplex 0ea43ea59e fixup! core: send a badge request at once from a build for the dev badge service 2026-10-20 15:37:53 +04:00
spacedandy-agents-simplex c0619385e9 fixup! badge-service: let a dev deployment ask its mock store while coverage runs 2026-10-20 15:37:53 +04:00
spacedandy-agents-simplex e570748206 fixup! badge-service: let a dev deployment ask its mock store while coverage runs 2026-10-20 15:37:53 +04:00
spacedandy-agents-simplex 1193ae953f core: send a badge request at once from a build for the dev badge service
/_badge request <userId> sends the profile's badge request now, while
its badge is shown, and runs the badge pass on the answer, so a renewal
or an ended subscription can be watched by hand against the dev
service.

It is allowed only when ChatConfig's badgeDevRequests is set, which no
shipped build does and nothing sets at runtime: the dev-service branch
sets it beside its own badge service overrides. A request off the shared
expiry would tell requests apart, so every other build refuses it, and
it is refused from a paired remote controller.

Run: 011-subscription-tools, slice S3b
2026-10-20 15:37:53 +04:00
spacedandy-agents-simplex e116987e5b badge-service: let a dev deployment ask its mock store while coverage runs
[dev] check_store_during_coverage = on makes every issueBadge for a
subscription ask the dev mock, during paid coverage too, and bank the
month of a charge it can grant, issued once coverage reaches it. So a
renewal can be watched by hand without waiting a month, and a mock that
forgot the plan after a restart answers ended at once.

Off by default, and refused unless accept_unverified_store_receipts is
on, which is itself refused beside a real store: a real store has not
started its next charge while coverage runs, and asking spends the
quota every subscriber shares.

Run: 011-subscription-tools, slice S3a
2026-10-20 15:37:53 +04:00
spaced4ndy ff22df9cdc update plan 2026-10-20 15:27:18 +04:00
spaced4ndy 53683c415d shorter plan 2026-10-20 14:49:13 +04:00
spaced4ndy 77479516d2 transfer plan 2026-10-20 14:35:26 +04:00
spacedandy-agents-simplex 26f846e1a5 fixup! core: retire a subscription badge as soon as its store says it ended 2026-10-20 06:29:36 +00:00
spacedandy-agents-simplex 5dc5da61b2 docs: record that a badge subscription cannot be restored or bought again
Restoring a subscription on a new device or under another profile fails for two independent reasons, the client's restore reading only unfinished transactions on iOS and the service answering any key but the one it credited receipt_used, and a lapsed iOS subscriber cannot subscribe again on the same install either. Both gaps files record it in their own format, and both restorePurchases() say why reading the store's entitlements alone would not help.

Run: 010-subscription-lifecycle, slice S2c
2026-10-20 03:29:19 +00:00
spacedandy-agents-simplex 55d69781e8 core: retire a subscription badge as soon as its store says it ended
A subscription badge retired only on an ended answer to a request that was due, and only once the ledger's paidThrough had passed, so an ended answer while the ledger still covered, or the iOS app's report of StoreKit's expired or revoked state, left the badge shown, Support SimpleX unreachable and every purchase refused until a later request. Now an answered ended state is stored even while coverage runs (the service writes it only from a store check, after which it grants nothing), and every pass retires a subscription whose state, from this pass's answer or else as stored, is ended, whatever the ledger covers. The paidThrough guard stays at the prepaid call site, its only remaining user.

Run: 010-subscription-lifecycle, slice S1
2026-10-20 03:10:59 +00:00
spaced4ndy 2d093d8c0a ui wip 2026-10-19 20:58:34 +04:00
spaced4ndy 2058daf700 ui 2026-10-19 19:29:21 +04:00
spacedandy-agents-simplex f82b1e3301 docs: replace the badge subscriptions diagrams README with a short summary
A plain-English summary for anyone on the team, with the seven
diagrams and a self-contained HTML page; the plan links it again.
Diagrams follow the branch: Restore purchases is on Support SimpleX,
"Renewing" shows past paidThrough, and only a present retryAfter is
raised to an hour.
2026-10-19 19:28:07 +04:00
spaced4ndy a1392e2713 ios: no alert when a badge purchase is cancelled 2026-10-19 18:29:49 +04:00
spaced4ndy b5b9b664dd ios, android, desktop: smaller Restore purchases label 2026-10-19 18:23:32 +04:00
spacedandy-agents-simplex 27311bd84f docs: keep only the badge subscription diagrams, with a README
The reviewer summary leaves the repo; the folder keeps the seven
diagrams with a README that captions each, and the plan links the
README.
2026-10-19 18:20:01 +04:00
spaced4ndy 9e62d09941 ios, android, desktop: show the badge privacy policy in the app 2026-10-19 18:13:09 +04:00
spaced4ndy e2119cef14 ios, android, desktop: restore purchases on the Support SimpleX screen 2026-10-19 18:08:36 +04:00
spacedandy-agents-simplex 8166b69ec8 docs: summarize the badge subscriptions PR for reviewers, with diagrams
A summary of PR #7716 as built: buying, renewing and retiring on each
store, the retirement window, lanes and store limits, RPC, API and
database changes, alerts, tests, open items, and a review map. Seven
SVG diagrams, an HTML page with them inline, and a link from the plan.
2026-10-19 18:05:27 +04:00
spaced4ndy 140db8db88 ios, android: hide Restore purchases on the order screen 2026-10-19 17:57:51 +04:00
spaced4ndy da39d8923a update ios lib 2026-10-19 16:53:47 +04:00
spaced4ndy ffb036680f update postgres schema 2026-10-19 15:37:45 +04:00
spacedandy-agents-simplex a2e9456e6d ios, android, desktop: use the dev badge page for testing (don't merge) 2026-10-19 11:19:14 +00:00
spacedandy-agents-simplex ea359edb66 ios, android, desktop: choose a badge in the app 2026-10-19 11:18:25 +00:00
spacedandy-agents-simplex d50488460d Merge branch 'master' into f/badge-subscriptions
# Conflicts:
#	src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt
2026-10-19 09:49:17 +00:00
spaced4ndy 0eeac1bb92 docs: normalize badge in-app checkout wireframe 2026-10-19 13:00:31 +04:00
sh bdc4edc524 nix: build armv7a from master with ghc 8.10.7 (#7763) 2026-10-19 09:07:52 +01:00
EvgenyandEvgeny @ SimpleX Chat 924f2b9644 api: fix python code generation (#7764)
* api: fix python code generation

* fix python types

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-19 08:32:09 +01:00
spacedandy-agents-simplex ebc0c532b9 fixup! core: add the badge subscription columns in their own migration 2026-10-19 07:23:28 +00:00
EvgenyandEvgeny @ SimpleX Chat a766d0af0f ci: package releases with drafts in simplex-chat-libs (#7754)
* ci: package releases with drafts in simplex-chat-libs

* test release

* core: 7.1.0.12

* packages: release nodejs and python libraries

* fixes

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-19 07:50:09 +01:00
EvgenyandEvgeny @ SimpleX Chat 0563460204 core, ui: support block markdown (#7734)
* plan: support block markdown

* update plans

* core, ui: markdown plans and implementation

* better

* simplify

* markdown tests and fixes

* implement

* fixes

* fix test

* bold

* block markdown rendering

* fix selection and rtl

* fixes

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-18 22:44:33 +01:00
EvgenyandEvgeny @ SimpleX Chat 5a5a927821 ci: reduce the number of runners (#7750)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-18 11:40:08 +01:00
EvgenyandEvgeny @ SimpleX Chat 1d0247b7dd core: preserve profile peer type when connecting incognito (#7751)
* core: preserve profile peer type when connecting incognito

* Apply batched suggestions from code review

Co-authored-by: Evgeny <evgeny@poberezkin.com>

* fix

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-18 08:51:33 +01:00
EvgenyandEvgeny @ SimpleX Chat 139ce5f8cc core: fix profile creation and update in channels (#7740)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-17 19:49:30 +01:00
EvgenyandEvgeny @ SimpleX Chat 77f9f4a464 core: add peer type "agent" (#7738)
* add agent peer type

* bot types

* agent app icons

* refactor

* smaller image

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-17 19:23:53 +01:00