Skip to content

QA: allow a launch extra to name the file server - #2183

Open
mpretty-cyro wants to merge 1 commit into
session-foundation:devfrom
mpretty-cyro:feat/qa-file-server-extra
Open

QA: allow a launch extra to name the file server#2183
mpretty-cyro wants to merge 1 commit into
session-foundation:devfrom
mpretty-cyro:feat/qa-file-server-extra

Conversation

@mpretty-cyro

Copy link
Copy Markdown
Collaborator

Adds sessionFileServerUrl / sessionFileServerPubkey launch extras, so a QA run can point the app at a file server it names.

Why

The debug menu can already select an alternative file server, but only from a hardcoded list of remote test servers (TEST_FILE_SERVERS). There was no way to name an arbitrary one, so a locally-hosted file server was unreachable on this platform.

That blocked more than convenience. The other two clients can already be told: iOS takes the same pair as customFileServerUrl / customFileServerPubkey launch args, Desktop takes TEST_FILE_SERVER_URL / TEST_FILE_SERVER_ED_PK. Android could not — so with a local file server configured, Android uploaded to production while the other client read from the local one, and the download simply never resolved.

The consequence in the test suite is that no Android attachment has ever been verified reaching another platform, because it could not be. There are no cross-platform media specs at all today, and this is why.

What it does

  • Writes the existing alternativeFileServer preference rather than adding a parallel one, so the app keeps a single notion of "not the production file server". AttachmentUploadJob and AvatarUploadManager read it live at upload time.
  • Ed25519, matching what FileServer stores and what Desktop is given — not the X25519 form iOS takes. FileServer.x25519PubKeyHex derives that itself, so passing the X25519 key here would be wrong twice over.
  • Both-or-neither, and present-but-empty clears the override — the same conventions as the sessionProBackendUrl pair it is modelled on.
  • Registered in the recognised-extras list, so a typo is still reported by warnOnUnrecognisedExtras rather than silently doing nothing.
  • QA-only: reachable only where ALLOW_QA_LAUNCH_CONFIG is set, like the rest of QaLaunchConfig.

Verification

Not inferred from the build — confirmed on device. With the extras passed:

QaLaunchConfig: Setting file server override to http://192.168.139.2:8000 (takes effect on next launch)
AttachmentUploadJob: Attachment uploaded successfully.

and the receiving client then renders the attachment. Before this, the same test waited out a 60s download timeout on every attempt.

Note for reviewers

A wrong key here fails inside the onion request rather than at configuration time, so a mismatch presents as a download that never resolves rather than as an error. That is the reasoning behind rejecting a half-supplied pair instead of half-applying it, and behind the explicit Ed25519 length/charset check.

The debug menu can already select an alternative file server, but only from a
hardcoded list of remote test servers -- there was no way to name an arbitrary
one, so a locally hosted file server was unreachable on this platform.

That blocked more than convenience. iOS takes the same pair as launch args and
Desktop as environment variables, so with a local file server configured Android
uploaded to production while the others read from the local one: a cross-platform
attachment test involving Android could not work at all, and none has ever
existed. The upload and the download were looking at different servers.

Writes the existing `alternativeFileServer` preference rather than adding a
parallel one, so the app keeps a single notion of "not the production file
server", and `AttachmentUploadJob` reads it live at upload time.

ED25519, matching what `FileServer` stores and what Desktop is given -- NOT the
X25519 form iOS takes, which `FileServer.x25519PubKeyHex` derives itself.

Both-or-neither and present-but-empty-clears, as the Pro backend pair does, and
registered in the recognised-extras list so a typo is still reported rather than
silently doing nothing.

Verified on device: "Setting file server override to http://192.168.139.2:8000",
then "Attachment uploaded successfully." from AttachmentUploadJob.
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