SemanticMediaWiki / SemanticMediaWiki/SemanticFormsSelect

Wrong values in subfields when value is switched too quickly

Open
#61 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
6
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Soemone reported a very specific issue on one of my wikis.

You can test that here: https://archi-mediawiki.netlib.re/Sp%C3%A9cial:RunQuery/Recherche_avanc%C3%A9e?uselang=fr

  1. Select France in the Pays field.
  2. With the keyboard, use the tab key to select the Ville field.
  3. Quickly type str on your keyboard.

What happens then is that Strasbourg is selected but the Sous-quartier and Rue fields are populated with values from Stosswihr (the value before Strasbourg in the Ville list).
This is probably some kind of race condition because the queries are asynchronous.

I had a hard time reproducing on sandbox because you don't have so many values there, but I think I found a similar issue here: https://sandbox.semantic-mediawiki.org/wiki/Sp%C3%A9cial:RunQuery/Test_keyboard

  1. With the keyboard, use the tab key to select the first field.
  2. Quickly press down then up on your keyboard.

The second field should be empty but it is populated with values from Europe. (Probably because the query for Europe ends after the query for null.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the race condition at the linked ArchiMediaWiki and sandbox pages using the keyboard steps, then trace the asynchronous queries that populate the dependent fields. Done means rapid changes leave the selected value and its dependent fields consistent, including leaving the second field empty when the final selection is null.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.