Skip to content

fix: map every pro url entry to its url_pro_* field, and expose the missing three - #69

Merged
Bilb merged 2 commits into
mainfrom
qa/pro-url-registry-mapping
Aug 25, 2026
Merged

fix: map every pro url entry to its url_pro_* field, and expose the missing three#69
Bilb merged 2 commits into
mainfrom
qa/pro-url-registry-mapping

Conversation

@Bilb

@Bilb Bilb commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The bug

src/constants.cpp built pro_urls with two entries reading the generic registry fields:

pro_urls["privacy_policy"]   = SESSION_PROTOCOL_STRINGS.url_privacy_policy;      // not url_pro_*
pro_urls["terms_of_service"] = SESSION_PROTOCOL_STRINGS.url_terms_of_service;    // not url_pro_*

The registry carries both sets, and they are different pages:

entry was now
privacy_policy getsession.org/privacy-policy getsession.org/pro-privacy
terms_of_service getsession.org/terms-of-service getsession.org/pro-terms

session-desktop reads LIBSESSION_PRO_URLS for 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_page and url_pro_upgrade were never mapped. The missing faq is 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.

ProBackendUrlsType gains 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_URLS back out of the built module and asserted all eight values against session_protocol.cpp:

  ok   roadmap               https://getsession.org/pro#roadmap
  ok   privacy_policy        https://getsession.org/pro-privacy
  ok   terms_of_service      https://getsession.org/pro-terms
  ok   pro_access_not_found  https://sessionapp.zendesk.com/hc/sections/4416517450649-Support
  ok   support_url           https://getsession.org/pro-support
  ok   faq                   https://getsession.org/pro#faq
  ok   pro_page              https://getsession.org/pro
  ok   upgrade               https://getsession.org/pro#upgrade
keys returned: 8  mismatches: 0

For a change whose entire content is which string ends up where, compiling is not evidence — hence the value assertion.

The vendored libsession-util submodule is unchanged; this is a binding fix, not a registry change.

🤖 Generated with Claude Code

…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 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>
@Bilb
Bilb merged commit d582d79 into main Aug 25, 2026
3 of 4 checks passed
@Bilb
Bilb deleted the qa/pro-url-registry-mapping branch August 25, 2026 01:51
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.

2 participants