Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending a 'sortChapters' message immediately after creating a chapter receives a different ordered 'chapters' message #16564

Open
Siderite opened this issue Dec 10, 2024 · 0 comments
Labels

Comments

@Siderite
Copy link

Exact URL of where the bug happened

In any study you own

Steps to reproduce the bug

In my case, for the functionality to add a new chapter after the currently selected one, I wait until a chapter is created, then immediately execute study.makeChange('sortChapters', newOrder) or study.chapters.sort(newOrder), doesn't matter which. A 'chapters' message is received with the original sort order, not the one sent.

What did you expect to happen?

I expected the chapters to be reordered correctly.

What happened instead?

The chapters remain in the same order, but they do have the correct order if refreshing the page, meaning the 'chapters' message received is wrong.

Operating system

Windows 11

Browser and version (or alternate access method)

Brave

Additional information

If the 'sortChapters' is sent with a timeout of one second, then the reply comes correctly and everything works as expected.

Data:

sent: {"t":"sortChapters","d":["Z7WDBei8","u1Mnkg2p","wROsB24O","rZ1J1mfn","7c6YaA9y"]}

received: {"v":9,"t":"chapters","d":[{"id":"Z7WDBei8","name":"Chapter 1"},{"id":"u1Mnkg2p","name":"a1"},{"id":"wROsB24O","name":"aa1"},{"id":"7c6YaA9y","name":"Chapter 2"},{"id":"rZ1J1mfn","name":"aaa1"}]}
@Siderite Siderite added the bug label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant