Skip to content

E2E: settings blur test sometimes sees a synced value replace the focused field #496

Closed

Description

@chhoumann

tests/e2e/settings-tab.test.ts "blur keeps an external setting received after the focused edit was saved" failed once in a fresh full npm run test:e2e run on Obsidian 1.14.4 (Linux), at line 279:

- Expected
+ Received
  {
-   "field": "Local/{{title}}.md",
+   "field": "Remote/{{title}}.md",
    "focused": true,
    "memory": "Remote/{{title}}.md",
  }

The test types into Episode note path, waits for the save, writes a changed data.json as if from sync, and calls onExternalSettingsChange. While the field keeps focus, it expects the field to keep showing the user's text and the settings to hold the synced value. In the failing run, the synced value replaced the text in the focused field. It passed in the other full run and in a filtered rerun, and no earlier run on record failed it.

It is not yet known whether this is a test timing problem or a product race, for example between the raw file event path from #480 and onExternalSettingsChange. If it is the product, an incoming sync change can replace the text in a field the user is editing.

Log: https://files.bagerbach.com/settings-blur-failure-full-01-zl3xd4n4bnqo.log
Screenshot: https://files.bagerbach.com/settings-blur-failure-osi7or7wymv4.png

Seen during the verification of #495. Related: #480.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions