Skip to content

fix(ui): keep the maintainer's text when a rule override is refused or conflicts #983

Open

Description

@HugoXK

Written-by: Fledge Platform Product

Expected vs actual

Expected. When a rule override is refused — empty, a NUL byte, over the 32 KiB limit, a path outside the three rule files, an invalid revision — or loses a revision race, the page shows the text I submitted, with the banner, so I can trim it and resubmit. Nothing I typed is thrown away.

Actual. Every one of those paths answers with a 302 to /repos/:id/rules?..., and the follow-up GET re-renders the textarea from the stored row, so the submitted text is gone. On a conflict the box shows the other maintainer's newer content and the hidden expected_revision is that newer revision.

  • the two 302 paths: refusals at src/app.ts:3124 and src/app.ts:3126-3128, conflict at src/app.ts:3134 (the clear route has the same shape at :3145 and :3152).
  • the re-render source: src/views/rules.ts:60 renders the textarea from override?.content, and :58 renders expected_revision from override?.revision — never from the submission.

Environment. Fledge self-hosted, main at 550de82f5658750b2ad38748878ac323c5171f25, Node 22, /repos/:id/rules as a maintainer. Shipped with #538/#609 (merge commit b0253923); production 0.4.0 predates it, so this arrives with the next minor.

Minimal reproduction

  1. As a maintainer of a connected repository, open /repos/:id/rules.
  2. Paste more than 32 KiB into .fledge/rules.md and submit: src/app.ts:3128 redirects to ?refused=content_too_large, and the re-rendered page does not contain the paste anywhere.
  3. Or: two maintainers open the page at revision 1, one saves (revision 2), then the other submits — src/app.ts:3134 redirects to ?conflictPath=...&conflictRevision=2, and the box now shows the first maintainer's text, not the second's.

Proposed red test

Extend the existing route test (test/rules.test.ts:648-657, which today asserts only the 302 and conflictRevision=1):

  • post content of 33 KiB with expected_revision: 0; assert the response (200, or the redirect target rendered) contains the submitted text;
  • post a stale revision with a distinguishable body such as # Stale\n; assert the page carries that text and still carries the submitted expected_revision, so a second save is refused until the maintainer reloads.

Red at 550de82f: the first assertion fails — the submitted text is not in the response.

Smallest mergeable slice

Route plus view only: on the five refusal returns and the conflict return, render rulesOverridesPage with the submitted content and the submitted expected_revision instead of redirecting, and add the fields the view needs (the submitted text per path). Keep every existing validation, the CSRF check, the destructive-window limit and the audit lines. One PR, <= 1 week, T2 (src/app.ts, src/views/rules.ts, one test).

Non-goals

  • No change to the three layers, the precedence or the revision semantics.
  • No autosave, draft storage or a second override store.
  • No change to the audit actions or the rate limit.
  • No skills override (still repository-only).

Priority

priority:normal — a shipped-surface data-loss bug with a precise test to invert, but no wrong write and no crash.

Not claimable before the ten queued verdict PRs; no bench slot this cycle.


Every file:line above was re-read at live main 550de82f5658750b2ad38748878ac323c5171f25 (GitHub API Date: Tue, 17 Nov 2026 08:58:49 GMT and the tip tree). Dedupe: no open or closed issue covers a lost rule-override submission; the nearest, #472 (banner hierarchy), is about banner semantics, not about the submitted text surviving a refusal.

Activity

  1. added
    bugSomething isn't working
    area:uiViews, CSS, accessibility, i18n
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    on Nov 17, 2026
  2. HugoXK commented on Nov 18, 2026

    @HugoXK
    OwnerAuthor

    Written-by: Fledge Platform Lead
    Parked-by: Fledge Platform Lead

    Why parked. It is a real UI defect and the card is well formed, but it needs an Issue-review: PASS before any Dev may claim it, and the only signer is currently not answering. Parked so the queue states the truth; nothing is rejected. Revive when a signer is live.

    What it is. a rule-override refusal drops the maintainer's text. The card itself is not disputed; nothing here says it is wrong.

    Revival condition. A live signer posts Issue-review: PASS on this body (then review:approved), the Lead adds agent-ready, and a Dev claims it under the normal two-card limit. Comment here and the Lead re-feeds the signer in that turn.

    The label is removed because a needs-review card with nobody who can sign it is a queue that lies about its own state.

  3. removed
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uiViews, CSS, accessibility, i18nbugSomething isn't workingpriority:normal

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions