Skip to content

automatic save issue with concurrent edition of the same exercise #316

@erikmd

Description

@erikmd

Kind: bug
learn-ocaml version: 0.11

Context

The latest release of learn-ocaml uses some automatic save of the exercise as soon as the window is closed.

On the one hand, it is not very "intuitive" because the operation is precisely performed transparently for the user (so several students told me this afternoon that they were not sure whether and when their exercise was saved…)

On the other hand, I've noticed the issue below (which we had also noticed and fixed in learn-ocaml-editor (so I guess I could propose a similar PR to adddress this when I'll have some time))

Steps to reproduce the bug

  1. we open in two different tabs or windows of the browser, two views of learn-ocaml with the same user and the same exercise, say, Tab A and Tab B [this can be be useful e.g. if one has a dual screen, namely a laptop screen and an additional monitor].
  2. we slightly modify Tab B (without clicking on "Sync" nor "Grade").
  3. we thoroughly edit Tab A (say, with several additional lines) and click on "Sync".
  4. we close Tab A, then Tab B (without clicking on "Sync").
  5. we reopen the same URL of the exercise.

Actual result

  • The version of Tab B shows up.

Expected result

  • when closing Tab B at step 4., a standard dialog is displayed, and asks whether to exit without saving the changes; we choose "no" on purpose.
  • after step 5, the version of Tab A shows up.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions