Repository navigation
Wraps a nested secret question in the editor - #261
Merged
Merged
Conversation
The screen editor page typed each posted response by a type map built from the top-level nodes alone, so a secret question inside a container would sit in the page's draft as plain text and a crash report could print it. typed/2 now finds secret questions by Journey.secret_keys/1, made public for it, which walks a container's nodes at any depth. A test moves the tried PIN screen's secret question inside a variant in the page's state, types a sentinel, and asserts the draft holds it as a SecretResponse and neither the inspected state nor the crash report of a failed press carries it. Refs: se-3sjb
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.
What
The screen editor page held a secret question's typed text wrapped in
StatifierExamplesWeb.SecretResponseonly when the question was one of theview's top-level nodes:
typed/2built its type map from the top-level nodesalone. A secret question inside a container would have sat in the page's
draft as plain text, where a crash report could print it. No screen riddler
presents today keeps a container (a variant resolves to the candidate that
wins), so the gap was latent.
typed/2now finds secret questions withJourney.secret_keys/1, the walkJourney.resolve/2already uses to keep them out of the view's responses. Itrecurses into a container's
nodesat any depth. The function was private;it is now public with a doc, so both readers share one walk.
Test
A new test in
ScreenEditorLiveTest("a PIN typed on the page inside acontainer is held wrapped and is in no line of the crash report") tries the
PIN screen, moves its secret question inside a variant in the page's own
state, types a test-only sentinel, and asserts:
SecretResponse;Sabotage:
typed/2reverted to the type lookup over the top-level nodesalone. The new test failed on its
SecretResponseassertion. The file wasthen restored from a copy, byte-equal.
Provenance
Journey.secret_keys/1public rather thanextracting a helper module: it is the smaller change, and the app never
ships as a package.
:sys.replace_state/2. The page's only source of view nodes is a resolvedscreen, and none of those keeps a container today.
Gate
mix qualitygreen on this head: format, compile with warnings as errors,credo, dialyzer, dependencies, and the full suite (916 of 916, 87.7 percent
coverage).