Skip to content

Say when Flow ID is out of reach or busy instead of its code - #6

Merged
kualta merged 5 commits into
mainfrom
connection-codes
Nov 26, 2026
Merged

kualta merged 5 commits into
mainfrom
connection-codes

Conversation

@kualta

@kualta kualta commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Waits on @flow-industries/seal 0.4.0 being published (flow-industries/seal#7). package.json already asks for ^0.4.0, but bun.lock still pins 0.3.1, because no lockfile can name 0.4.0 before it exists on npm. Until it does, CI's bun install --frozen-lockfile fails. Once 0.4.0 is out, this branch gets a regenerated bun.lock and a CI rerun.

Seal 0.4.0 reports a dropped connection (CONNECTION_LOST, UPLOAD_INCOMPLETE) as the sync reason "connection", and too many uploads in flight (UPLOAD_BUSY) as "busy". While it retries, it publishes SYNC_CONNECTION_FAILED and SYNC_BUSY. It also exports transientFailure(error), which returns "connection", "busy" or undefined. This PR puts both into words, and no Flow ID code reaches the person any more:

  • Status bar. statusWords in src/device.ts, used by statusText:

    • SYNC_CONNECTION_FAILED reads "Connection to Flow ID failed; changes are kept and sync resumes once it's back";
    • SYNC_BUSY reads "Syncing again in a moment";
    • every other status passes through as before.
  • Errors. failureWords in src/device.ts gives every refusal Flow ID's SDK throws (a string code beside a numeric status) one of three lines:

    Code Line
    Failed connection (CONNECTION_LOST, UPLOAD_INCOMPLETE) "The connection to Flow ID failed. Try again in a moment."
    PDS_UNAVAILABLE (also what a gateway's error page reads as during an outage) "Flow ID isn't available right now. Try again in a moment."
    Busy "Flow ID is busy with other uploads from your account. Try again in a moment."
    Any other code "Flow ID couldn't complete that. Try again later."
    • Unchanged: an error without such a code keeps its own message.
    • Link modal: it uses these lines as they are, through messageOf.
    • Stop notice and settings: they add "Your changes are kept." Before this, an open or a link that Flow ID refused showed the raw code (CONNECTION_LOST, PDS_UNAVAILABLE, RATE_LIMITED and so on) in all three places.
  • README. A "What syncs" line on what happens when the connection to Flow ID fails, and where its status shows: in the status bar, or in settings on mobile.

  • Version. 0.1.2 to 0.1.3 in manifest.json, package.json and versions.json. No tag is pushed.

The wording follows NOTE's: a failed connection may be on either side, and an UPLOAD_INCOMPLETE means Flow ID was reached, so no line says Flow ID couldn't be reached or blames the person's network.

Testing

These ran locally under Bun 1.4.2, against seal 0.4.0 built from flow-industries/seal#7 and Flow ID SDK 0.38.1, both linked into node_modules:

  • bun run lint: clean;
  • bun run lint:obsidian: 0 errors (13 existing warnings, none on changed lines);
  • bun run typecheck: clean;
  • bun test: all pass, the e2e included;
  • bun run build: clean;
  • bun run smoke: main.js loads, needing only obsidian and @lezer/*.

A fresh install against a packed seal 0.4.0 resolves SDK 0.38.2, which brings @flow-industries/ui and React in as peers. At the same commit (ce7fc7d), that build gave a main.js byte-identical to the 0.38.1 build (1,062,282 bytes), with no React or UI code in it.

New tests:

  • e2e: "a failed connection to Flow ID reads as a wait, never a code, and syncs once it's back". It drives the real device client against seal's in-memory Flow ID with every request failing as a dropped network:
    • an open vault's status becomes SYNC_CONNECTION_FAILED;
    • an open from closed stops with the failed-connection words and "Your changes are kept", once, in a notice;
    • with the network back, Sync now opens the vault, and all three notes reach NOTE.
  • controller:
    • each of CONNECTION_LOST, UPLOAD_INCOMPLETE, PDS_UNAVAILABLE, UPLOAD_BUSY, RATE_LIMITED, RECONNECT_REQUIRED and DEVICE_LINKING_DISABLED at open stops in words that never contain the code;
    • the link modal's words leave out "Your changes are kept";
    • an error with a code but no status keeps its own message;
    • statusWords maps the two new statuses and passes the rest through;
    • followsRead never counts the two new statuses.

Simplify pass: done on the full diff, review fixes included. It found nothing further to fix or simplify.

One existing behavior is unchanged: a vault that can't reach Flow ID as it opens stops until Retry or Sync now. Its words say to try again, so they don't promise an automatic retry.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T17:30:48.013033Z 2e9bc86 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e9bc86f77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
},
"dependencies": {
"@flow-industries/seal": "^0.3.1"
"@flow-industries/seal": "^0.4.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Regenerate the lockfile for Seal 0.4.0

This manifest now requires Seal 0.4.0, but bun.lock still declares and resolves ^0.3.1/0.3.1. Both CI and release run bun install --frozen-lockfile (.github/workflows/ci.yml:24 and .github/workflows/release.yml:29), and Bun documents that flag as “Disallow changes to lockfile,” so installation exits before any checks run; without frozen mode, the committed lock also lacks the new exports imported by this change. Regenerate and commit bun.lock for 0.4.0.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

@kualta
kualta merged commit 4f57204 into main Nov 26, 2026
1 check passed
@kualta
kualta deleted the connection-codes branch November 26, 2026 21:55
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