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

Feature submissions store #1443

Merged
merged 6 commits into from
Aug 10, 2020
Merged

Feature submissions store #1443

merged 6 commits into from
Aug 10, 2020

Conversation

flbulgarelli
Copy link
Member

@flbulgarelli flbulgarelli commented Jul 31, 2020

🎯 Goal

This PR introduces the SubmissionsStore, a JS repository for user progress that replaced the one-variable last-submission cache.

This has two consequences:

  1. All progress is going to be stored in the client. This has no actual impact on the behavior of mumuki, but will be leveraged in next PRs
  2. The last-submission cache is now persistent.
    1. 👎 This should have no real impact to end-users in normal conditions, but is something that content-editors must take into account - now when performing an additional request after a content change, they will have to clear local storage, which is more cumbersome, I know.
    2. 👍 But the good news is that now end-users will not accidentally break their progress if they send an already-passed submission from the same device after a content change.

⚠️ Pitfalls

This API is not yet stable, and I may change in the near future, but is consistent enough to merging into main branch and start using it.

📝 Details

  • This PR introduces the global currentExerciseId
  • This PR adds more type information
  • This PR converts bridge to an ES6 class

🔜 Future work

More tests and documentation will be added when this API is stabilized.

🔙 Backward compatibility

This PR is not backward compatible

👀 See also

@flbulgarelli flbulgarelli force-pushed the feature-submissions-store branch from 451e351 to 0a5b4f5 Compare August 3, 2020 00:24
@flbulgarelli flbulgarelli requested a review from luchotc August 9, 2020 18:57
@flbulgarelli flbulgarelli marked this pull request as ready for review August 9, 2020 18:58
Copy link
Contributor

@luchotc luchotc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just note that one comment 😄

return JSON.stringify(object);
}

_keyFor(exerciseId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! Just take into account that this may conflict in the future with organization-separated progress. ⚠️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flbulgarelli flbulgarelli merged commit 0f75799 into master Aug 10, 2020
@flbulgarelli flbulgarelli deleted the feature-submissions-store branch August 10, 2020 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants