Skip to content

fix(question): apply the extra settings the server adjusted - #4077

Closed
AndyScherzinger wants to merge 1 commit into
mainfrom
fix/question-adjusted-extra-settings
Closed

AndyScherzinger wants to merge 1 commit into
mainfrom
fix/question-adjusted-extra-settings

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

What it solves

When the server adjusts the extra settings of a question on save, it says so in the X-Forms-Adjusted response header, and the editor loads the question again. The editor then threw the loaded settings away. It only applied them when the settings it had sent were still the current ones, and it checked that by object identity. The debounced save always sends a copy, so the check never passed.

What you can see: narrow a linear scale from 1–5 to 1–4 while value 5 has a jump. The server removes that jump, but the editor keeps it. Widen the scale back to 5, and the editor saves the removed jump again.

What changed

The editor now applies the loaded settings unless newer changes are still waiting to be saved.

How to test

  1. Create a form with a linear scale (1–5) and a second question. Turn on "Go to based on answer" and let value 5 go to the second question.
  2. In the scale's actions, set Highest value to 4, then back to 5.
  3. Before: value 5 jumps to the second question again. After: value 5 has no jump.

The new e2e test Narrowing a linear scale drops the jumps of the removed values in the editor as well in playwright/e2e/jumps.spec.ts covers this. It fails on main and passes with the fix (checked on Nextcloud 35).

The same commit is part of #4076, which needs the editor to apply adjusted settings for the media kind detected by the server.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

When the server adjusts the extra settings of a question on update, it
reports this in the header X-Forms-Adjusted, and the editor loads the
question again to show the stored settings. The editor only applied
them when the settings it had sent were still the current ones, and it
compared them by identity: the debounced save sends a copy of the
settings, so the comparison never held and the adjusted settings were
dropped. Narrowing a linear scale kept the removed jumps in the editor,
and the next save sent them again.

Apply the loaded settings unless newer changes are pending or queued.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the fix/question-adjusted-extra-settings branch from 93ae727 to 02c9655 Compare December 3, 2026 12:17
@AndyScherzinger

Copy link
Copy Markdown
Member Author

Closing: the fix landed on main with #4076, which carried the same commit (18f9376), so this PR no longer changes anything apart from its e2e test.

Assisted by ClaudeCode:claude-opus-5-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants