fix: map every pro url entry to its url_pro_* field, and expose the missing three - #69
Merged
Conversation
…issing three `pro_urls["privacy_policy"]` and `pro_urls["terms_of_service"]` read the GENERIC `url_privacy_policy` / `url_terms_of_service`, so an object named `pro_urls` handed consumers Session's general terms and privacy pages instead of the Pro ones. session-desktop reads these for its Pro settings links, so those two links pointed at `/privacy-policy` and `/terms-of-service` rather than `/pro-privacy` and `/pro-terms`. The registry carries both sets; only the Pro set belongs here. Also maps the three Pro urls that were never surfaced: `url_pro_faq`, `url_pro_page` and `url_pro_upgrade`. The missing `faq` was load-bearing downstream — session-desktop hardcodes that url today with a comment calling itself a copy under protest, precisely because it was unreachable here. `ProBackendUrlsType` gains all three, since a consumer cannot use a field the type does not declare. Existing key names are left alone: session-desktop reads them, so renaming would break a separate repo. The three new keys follow the object's dominant bare-name convention (`faq`, `pro_page`, `upgrade`) rather than the two outliers (`support_url`, `pro_access_not_found`). Verified by reading `CONSTANTS.LIBSESSION_PRO_URLS` out of the rebuilt module and asserting all eight values against the registry in `session_protocol.cpp`: 8 keys, 0 mismatches. The vendored `libsession-util` submodule is unchanged — this is a binding fix, not a registry change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mpretty-cyro
approved these changes
Aug 25, 2026
mpretty-cyro
pushed a commit
to session-foundation/libsession-util-android
that referenced
this pull request
Aug 25, 2026
session-android hard-codes five Pro URLs in `ProUrls.kt`, and that file documents why: "the registry is a C struct of `const char*` with no accessor exposed to Kotlin, so consuming it directly would mean adding JNI surface for five constants." It also records the cost of copying — "every value here was once wrong at the use site that needed it." libsession owns these values. This removes the excuse. Adds `BackendRequests.proUrls(): ProUrls`, returning all eight `url_pro_*` fields as one object, in the same shape as the existing `providerUrls(slug)`: a `@Keep` data class, a `serialize_pro_urls` JNI helper mirroring `serialize_provider_urls`, and an `extern "C"` entry point beside it. **Glue-only — no C++ change was needed.** `SESSION_PROTOCOL_STRINGS` is already `extern const` in the public header `session/session_protocol.h`, so the JNI layer reads it directly and the vendored submodule is untouched. Worth noting in `ProUrls`: `privacyPolicy` and `termsOfService` are the **Pro** documents (`url_pro_privacy_policy` / `url_pro_terms_of_service`), not Session's general ones. The registry carries both pairs and they are different pages — the equivalent nodejs binding had exactly that bug (session-foundation/libsession-util-nodejs#69). Verified end to end, not just compiled: session-android built against this glue via the `session.libsession_util.project.path` override, with `ProUrls.SUPPORT` switched to `BackendRequests.proUrls().support`, and the full `@android @pro` suite passed 29/29 on a device — including the refund specs that open that URL. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI runs `clang-format-19 --dry-run --Werror`, and three lines of the comment added in the previous commit ran past ColumnLimit: 100, so the whole ubuntu job failed on formatting alone. Rewrapped by hand rather than via `pnpm lint`: the repo's devDependency ships clang-format 15, which additionally wants to reformat include/utilities.hpp:469 - a file CI's v19 is happy with and this branch never touched. Verified against the CI log that v19 flagged these six positions and nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The bug
src/constants.cppbuiltpro_urlswith two entries reading the generic registry fields:The registry carries both sets, and they are different pages:
privacy_policygetsession.org/privacy-policygetsession.org/pro-privacyterms_of_servicegetsession.org/terms-of-servicegetsession.org/pro-termssession-desktop reads
LIBSESSION_PRO_URLSfor its Pro settings links, so its Pro terms and privacy links have been pointing at Session's general pages. That is a wrong link in the client UI rather than a naming quibble.The gap
url_pro_faq,url_pro_pageandurl_pro_upgradewere never mapped. The missingfaqis load-bearing downstream: session-desktop hardcodes that url today with a comment calling itself a copy under protest, precisely because it was unreachable through this binding.ProBackendUrlsTypegains all three — a consumer cannot use a field the type does not declare, so the C++ change alone would only be half the fix.Naming
Existing keys are untouched: session-desktop reads them, so renaming is a breaking change for a separate repo. The three new keys follow the object's dominant bare-name convention (
faq,pro_page,upgrade) rather than the two outliers (support_url,pro_access_not_found).Verification
Rebuilt, then read
CONSTANTS.LIBSESSION_PRO_URLSback out of the built module and asserted all eight values againstsession_protocol.cpp:For a change whose entire content is which string ends up where, compiling is not evidence — hence the value assertion.
The vendored
libsession-utilsubmodule is unchanged; this is a binding fix, not a registry change.🤖 Generated with Claude Code