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

Avoid superfluous PUT requests for session settings upon opening a session #789

Open
schu opened this issue Mar 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working p2

Comments

@schu
Copy link
Member

schu commented Mar 22, 2024

If the user opens a session (/sessions/<ID>), there are number of unexpected PUT requests for the user settings:

image

The requests get triggered by the following reactive statements:

$: settingsShowSidebar = $UserSettings.session_show_sidebar;
$: settingsExamMode = $UserSettings.session_exam_mode;
$: settingsShuffleAnswers = $UserSettings.session_shuffle_answers;
$: settingsShowSidebar,
(()=> {
axios
.put("/api/users/me/settings", {
session_show_sidebar: settingsShowSidebar
})
.then(function (response) {})
.catch(function (error) {
alert(error);
});
})();
$: settingsExamMode,
(()=> {
axios
.put("/api/users/me/settings", {
session_exam_mode: settingsExamMode
})
.then(function (response) {})
.catch(function (error) {
alert(error);
});
})();
$: settingsShuffleAnswers,
(()=> {
axios
.put("/api/users/me/settings", {
session_shuffle_answers: settingsShuffleAnswers
})
.then(function (response) {})
.catch(function (error) {
alert(error);
});
})();

@schu schu added the bug Something isn't working label Mar 22, 2024
@schu schu self-assigned this Mar 22, 2024
@schu schu added p2 and removed needs triage labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

No branches or pull requests

1 participant