Skip to content

The panel sends a redirect only when somebody changed it - #105

Merged
kisielewski merged 1 commit into
mainfrom
feat/the-panel-reads-the-stored-redirects
Sep 6, 2026
Merged

The panel sends a redirect only when somebody changed it#105
kisielewski merged 1 commit into
mainfrom
feat/the-panel-reads-the-stored-redirects

Conversation

@kisielewski

@kisielewski kisielewski commented Sep 6, 2026

Copy link
Copy Markdown
Member

The other half of AlgoJudge/AlgoJudge-Server#96, and the half that actually fixes it.

settingsOf said this form knows the whole answer, so it says so and always
sent both redirect fields, blank when absent. It did not know the whole answer:
it reads getInstanceInfo, where a redirect naming a switched-off provider is
filtered away. So on an installation whose provider was down for an hour of
maintenance, saving anything on that tab cleared both columns, and re-enabling
the provider did not bring the redirect back.

Two halves.

The panel reads the columns from getInstanceRedirects and shows them
truthfully. A stored slug the provider list does not carry is offered as a
marked, selected option — switched off, so the screen draws itself, or no
provider is registered under this
— with an Alert under that field saying what
is happening and how to undo it. Only ever the stored value: offering an
arbitrary disabled provider would let somebody aim a redirect at a 404, which is
what the Server's 422 exists to refuse.

And it omits a redirect field it did not change. Absent means leave it alone,
which is the only honest thing a form can say about a value it may not be able to
see — and it closes a second hole for free: Instance has two writers, so an
always-sender overwrites a change made by aj-admin config apply with a value
read when the tab was opened.

settingsOf losing the two fields is load-bearing, not tidying: the effect
following instance re-seeds it from the filtered answer on every
instanceChanged, including the one this screen's own save causes.

The fake stopped stating its providers twice. The instance's list and the
manager's registrations were written out separately and happened to agree, so
switching a provider off in the panel changed nothing a screen saw. The list is
now projected from the registrations, and ?fakeProviders=off empties the
fixture rather than one half of it.

What the browser found that reading did not

  • An aborted read counted as a failure. useApiEffect already ignores a
    request its own cleanup cancelled, but a catch inside the effect swallows it
    first — so under React's development double-invoke the screen drew a value it
    had read and a note saying it could not read one, side by side.
  • A picker whose option list had not caught up drew its placeholder. Writing
    a provider announces nothing, so the list lags in both directions; the stored
    slug is added whenever the list does not already carry it.

And three assertions that passed for no reason

Worth stating, because each was green before it was right:

  • a needle written znak w aplikacji matched nothing — the Polish label carries
    a hard space after w, because Polish does not leave a one-letter word at
    the end of a line;
  • \s inside a template literal loses its backslash, so the browser was sent
    /s+/g and replaced the letter — the same defect this repository fixed in
    verify-external-content last week, and the file's own drawn() already
    writes \\s;
  • the sign-in screen no longer offers the provider passed on a screen that had
    not drawn. Removed rather than repaired: the manager walk runs signed in,
    so /login answers with a redirect and there is nothing to read. The file says
    so where the assertion used to be.

Three sabotages, each reddening the walk — including putting always-send back,
which now fails on the save itself went through: the old form is refused,
No enabled identity provider is registered under "university", so the setting
would have survived for the wrong reason.

lint, lint:deps, typecheck, build, check:i18n, check:api against the
regenerated document, and the seven other checks. Full check:ui: 51 of 51.

The form seeded itself from `getInstanceInfo`, whose two redirect fields are
filtered against the *enabled* providers — so while a provider was switched off
the pickers read *Brak*, and any save of that tab wrote the blank back and
cleared the column. Re-enabling did not bring it back, and nothing said so.

Two halves. The panel reads the columns from `getInstanceRedirects`, and shows a
stored slug the provider list does not carry as a marked, selected option with a
note under it saying the redirect is not in force. And it omits a redirect field
it did not change, which is the only honest thing a form can say about a value
it may not be able to see — and what keeps a second writer's change from being
overwritten by a baseline read when the tab was opened.

The fake stops stating its providers twice: the instance's list is projected
from the registrations, so switching one off in the panel reaches a screen.

Three sabotages, each reddening the walk. Two defects the browser found and
reading would not have: an aborted read counted as a failed one, and a picker
whose option list had not caught up drew its placeholder instead of the value.
@kisielewski
kisielewski merged commit 701895b into main Sep 6, 2026
3 checks passed
@kisielewski
kisielewski deleted the feat/the-panel-reads-the-stored-redirects branch September 6, 2026 17:52
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