The panel sends a redirect only when somebody changed it - #105
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The other half of AlgoJudge/AlgoJudge-Server#96, and the half that actually fixes it.
settingsOfsaid this form knows the whole answer, so it says so and alwayssent both redirect fields, blank when absent. It did not know the whole answer:
it reads
getInstanceInfo, where a redirect naming a switched-off provider isfiltered 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
getInstanceRedirectsand shows themtruthfully. 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
Alertunder that field saying whatis 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:
Instancehas two writers, so analways-sender overwrites a change made by
aj-admin config applywith a valueread when the tab was opened.
settingsOflosing the two fields is load-bearing, not tidying: the effectfollowing
instancere-seeds it from the filtered answer on everyinstanceChanged, 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=offempties thefixture rather than one half of it.
What the browser found that reading did not
useApiEffectalready ignores arequest its own cleanup cancelled, but a
catchinside the effect swallows itfirst — 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 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:
znak w aplikacjimatched nothing — the Polish label carriesa hard space after
w, because Polish does not leave a one-letter word atthe end of a line;
\sinside a template literal loses its backslash, so the browser was sent/s+/gand replaced the letter — the same defect this repository fixed inverify-external-contentlast week, and the file's owndrawn()alreadywrites
\\s;not drawn. Removed rather than repaired: the manager walk runs signed in,
so
/loginanswers with a redirect and there is nothing to read. The file saysso 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 settingwould have survived for the wrong reason.
lint,lint:deps,typecheck,build,check:i18n,check:apiagainst theregenerated document, and the seven other checks. Full
check:ui: 51 of 51.