Skip to content

Deploy master to staging: durable-write health and the empty-bearer fix - #634

Merged
QR-Madness merged 3 commits into
stagingfrom
master
Dec 1, 2026
Merged

QR-Madness merged 3 commits into
stagingfrom
master

Conversation

@QR-Madness

Copy link
Copy Markdown
Collaborator

Relay deploy to staging: master at aeb306f. Two relay changes:

Also on master: #631 (CJK text in PDF exports), which is editor-only. The editor reaches staging from master in the same staging run. Production stays pinned.

Assisted-by: Opus 5.5

* Print Chinese, Japanese and Korean text in PDF exports

PDF exports embedded only the document's font, so Chinese, Japanese and
Korean text came out blank, silently. Text the current face lacks now
falls back to Noto Sans SC (Han and kana) or Noto Sans KR (Hangul).

- FallbackDoc stands in front of the document the layout draws on and
  splits each string into runs by font. Text the face covers goes straight
  through, so Latin documents export byte for byte as before.
- The layout measures the fallback fonts from fallbackMetrics.json,
  generated from the fonts with jsPDF's own parser. Paper Mode never
  downloads them, and an export fetches one only when its text needs it.
  The fonts are hashed assets, never precached, and kept by the service
  worker after their first fetch.
- CJK text breaks between characters, with basic kinsoku rules. A space
  that doesn't fit ends a line instead of opening the next one, which also
  fixes Latin lines that began with a space.
- jsPDF can't draw characters outside the BMP (most emoji), and scripts
  that need shaping (Arabic, Hebrew, Indic) aren't covered. The export now
  says what it left out instead of dropping it silently.

Assisted-by: Opus 5.5

* Keep a code line's indentation when CJK text wraps it

From the review: wrapTokens dropped the spaces a paragraph opens with,
so a wrapped code line with CJK in it lost its indentation. MeasureDoc
now carries the fallbackFonts flag of what it measures with, so a
heading's look-ahead never shares width-cache entries with a plain
document. Contents labels shorten by characters, never inside a UTF-16
pair, and the two base64 helpers are one.

Assisted-by: Opus 5.5
RELAY_REVOCATION_BEARER set but empty became Some(""), which matched a
request carrying no bearer at all: the internal workspace hooks and the
revocation push accepted anyone. The setter now drops a blank bearer, so
the hooks answer 503 (off) and /metrics stays open, as with no bearer.
No environment runs with an empty bearer today; both deployed relays
refuse an unauthenticated hook call with 401.

Assisted-by: Opus 5.5
When writes to the object store fail, the relay keeps serving from its
volume and retries, and DurabilityMonitor sends an error event as the
outage starts. Nothing showed the state on /metrics. On a relay with an
object store, it now carries:

- relay_durable_writes_failing (0 or 1),
- relay_durable_write_consecutive_failures,
- relay_durable_write_last_success_timestamp_seconds (0 before the first).

A filesystem relay has no durable writes and shows none of them.

Assisted-by: Opus 5.5
@QR-Madness
QR-Madness merged commit 25a4981 into staging Dec 1, 2026
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