Skip to content

Conversation

@ParikKukreja
Copy link
Collaborator

@ParikKukreja ParikKukreja commented Apr 16, 2025

Resolves #3720

Problem - Users needed to complete the tutorial for every different city they used

Solution-

  • Added a tutorial_completed boolean column to the sidewalk_user table
  • Updated DBUser model to include tutorialCompleted field with default value of false
  • Modified hasCompletedAuditOnboarding method to check the user's tutorialCompleted flag instead of searching through missions
  • Added new markTutorialCompleted method to set the flag when a user completes the tutorial
  • Updated updateComplete method to automatically mark the tutorial as completed when a user completes an onboarding mission
Before/After screenshots (if applicable)
Testing instructions

Testing this feature is a little tedious, when I was testing it I created a new user, completed the tutorial in once city, and then loaded up another city.
It was important for the new city (the second one you're loading) to have been created before the first one, so you don't need to run make import-users again. See "setting up another city" in the dev environment documentation.

  1. Create a new dummy account for testing on localhost.
  2. In a new terminal in your root directory.
  3. Run make ssh target=db.
  4. Run psql -d sidewalk -U <database user>.
  5. Run SELECT user_id, username, email FROM sidewalk_user WHERE username = '<dummy username you created>' to get your user ID.
  6. Run SELECT user_id, username, tutorial_completed FROM sidewalk_user WHERE user_id = <user id>;.
  7. Observe the tutorial_completed column is false.
  8. Complete the 'explore' tutorial.
  9. Run the command from step 6 again and see if the boolean changed.
  10. Load up another city following the steps from the Dev environment documentation.
  11. Load up that city, login to your user if necessary, and explore.
  12. See that the tutorial is skipped!
Things to check before submitting the PR
  • I've written a descriptive PR title.
  • I've added/updated comments for large or confusing blocks of code.
  • I've included before/after screenshots above.
  • I've asked for and included translations for any user facing text that was added or modified.
  • I've updated any logging. Clicks, keyboard presses, and other user interactions should be logged. If you're not sure how (or if you need to update the logging), ask Mikey. Then make sure the documentation on this wiki page is up to date for the logs you added/updated.
  • I've tested on mobile (only needed for validation page).

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.

Stop suggesting a tutorial completion in every city for a user

3 participants