Skip to content

Repair label-watch migration under Qt 6.12; make checksums portable - #2

Merged
Pillumz merged 1 commit into
mainfrom
fix/label-ownership-tests
Oct 8, 2026
Merged

Pillumz merged 1 commit into
mainfrom
fix/label-ownership-tests

Conversation

@Pillumz

@Pillumz Pillumz commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

What

Repairs the three LabelOwnership failures and makes the source checksum gate portable.

Root cause

Qt 6.12 hands a value that crossed a signal or var boundary back as a V4Sequence: not an Array, but a sequence with an integral, finite length and the sequence methods. The migrated watched-label ids cross MailAccount.monitoredMigrated, so Accounts.idList read the V4Sequence as empty and a rename/delete cleared the watches instead of following them.

Fix: idList reads an Array directly and otherwise accepts only that genuine sequence shape — a non-Array object with typeof slice === "function" and a finite, integral, non-negative length — copying it by index into a plain JS array. A JSON object cannot carry a function, so malformed payloads stay as rejected as they were under the old Array.isArray-only check, and an unbounded length is never walked. Elements are copied by index, never by enumerating keys, so an own __proto__ is never run as a setter. Filtering, trimming and de-duplication are unchanged.

Checksum portability

tests/test_source.sh used shasum -a 256, which Arch does not ship. It now prefers sha256sum and falls back to shasum -a 256 — the same SHA-256 source-integrity gate, failing closed if neither exists.

Verification

Isolated offscreen runs, no owner display/bus, on both engines:

  • Qt 6.12.0 (work) and Qt 6.11.2 (home): make test-js, make test-shell, make test-qml all pass — make test-qml 1158 passed / 0 failed on each, including the three repaired LabelOwnership cases.
  • make test-js includes a focused safety-boundary regression: a plain object with a numeric length (and unbounded/infinite/negative/fractional lengths, strings, null) is rejected, while trimming/de-dup are preserved for a real sequence.
  • The genuine Qt V4Sequence path is exercised on 6.12 (the signal conversion); the same arrays on 6.11 take the Array.isArray path.

Diff against main is ui/account/Accounts.js, ui/tests/test_accounts.js, and tests/test_source.sh.

Provenance

Authored by DeepSeek V4.1 Flash (pi herd worker); not independently reviewed here.

Independent review

GPT-6.1 Sol reviewed exact revised head 91350b1. The initial arbitrary-numeric-length acceptance was rejected and is fixed: only real arrays or sequence-capable objects with finite integral nonnegative length are admitted, so malformed JSON objects cannot trigger new list acceptance or huge-length walks. Index copying preserves trimming/dedup and does not set prototype keys. SHA-256 fallback keeps the same expected digests and fail-closed checks. Reviewed focused malformed-input regression coverage; actual Qt sequence acceptance and both-engine suite runs are the author’s verification (1158/0 each), not claimed by this reviewer. No unresolved code concern.

@Pillumz
Pillumz force-pushed the fix/label-ownership-tests branch from e2aa9cd to 148032d Compare October 8, 2026 11:34
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

CI failed at 91350b1 (run). What each failed gate needs:

Released backend gate failed

The backend the plugin pins (backend-version) does not speak what backend-api.json calls its released API, or the released fixtures do not pass against it. Backends ship in batches, so an API change does not wait for a release — it is declared as the one unreleased step:

  • raise apiVersion to exactly releasedApiVersion + 1;
  • list every new method under unreleased.methods and every new or changed contract case under unreleased.cases;
  • leave the released cases as they are — the pinned binary has to keep passing them;
  • a feature that needs the step checks the connected backend against its fixed minimum API revision and waits until that requirement is met.
    If apiVersion is already a step ahead, the released view still changed: compare backend-api.json with the pinned release's copy (gh release download v$(cat backend-version) --pattern backend-api.json). See "Released and unreleased" in docs/BACKEND-RUNTIME.md.

Released backend gate failed

The backend the plugin pins (backend-version) does not speak what backend-api.json calls its released API, or the released fixtures do not pass against it. Backends ship in batches, so an API change does not wait for a release — it is declared as the one unreleased step:

  • raise apiVersion to exactly releasedApiVersion + 1;
  • list every new method under unreleased.methods and every new or changed contract case under unreleased.cases;
  • leave the released cases as they are — the pinned binary has to keep passing them;
  • a feature that needs the step checks the connected backend against its fixed minimum API revision and waits until that requirement is met.
    If apiVersion is already a step ahead, the released view still changed: compare backend-api.json with the pinned release's copy (gh release download v$(cat backend-version) --pattern backend-api.json). See "Released and unreleased" in docs/BACKEND-RUNTIME.md.

Fix, push, and the gates run again; this comment updates itself.

Qt 6.12 hands a value that crossed a signal or `var` boundary back as a
V4Sequence: not an Array, but a sequence with an integral, finite length and
the sequence methods. The migrated watched-label ids cross
MailAccount.monitoredMigrated, so Accounts.idList read the V4Sequence as empty
and a rename or delete cleared the watches instead of following them.

idList now reads an Array directly and otherwise accepts only that genuine
sequence shape — a non-Array object with typeof slice === "function" and a
finite, integral, non-negative length — copying it by index into a plain JS
array. A JSON object cannot carry a function, so it stays as rejected as it was
under the old Array.isArray-only check, and an unbounded length is never walked.
Elements are copied by index, never by enumerating keys, so an own "__proto__"
is not run as a setter. Filtering, trimming and de-duplication are unchanged; a
focused regression covers the malformed-payload boundary.

tests/test_source.sh hard-coded Perl's shasum, which Arch does not ship. It now
prefers sha256sum and falls back to shasum -a 256, keeping the same SHA-256
source-integrity gate.

Provenance: authored by DeepSeek V4.1 Flash (pi herd worker).
@Pillumz
Pillumz force-pushed the fix/label-ownership-tests branch from 148032d to 91350b1 Compare October 8, 2026 11:46
@Pillumz
Pillumz merged commit 2bc0fc6 into main Oct 8, 2026
11 of 14 checks passed
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