lambdaclass / mirra_backend

Multiplayer 2D physics engine, matchmaking, market and leaderboard for 2D and 3D Games
Apache License 2.0
61 stars 1 forks source link

Fix daily quest progress tracking #958

Closed AminArria closed 3 weeks ago

AminArria commented 3 weeks ago

Motivation

Closes #926

Summary of changes

How to test it?

The following steps assume you are starting from clean DB (mix ecto.reset)

  1. Create a new user (easier to login with Unity)
  2. Run the following SQL to move the daily quests to yesterday
    
    update users set last_daily_quest_generation_at = '2024-09-12 17:00:00';

update user_quests set activated_at = '2024-09-12 17:00:00', inserted_at= '2024-09-12 17:00:00', updated_at= '2024-09-12 17:00:00';

-- The line below could potentially mark the milestone quest as completed, but regardless I don't think its an issue update user_quests set status = (case when random() < 0.5 then 'completed' else 'available' end) ;


3. Login again through Unity to create todays quests

Now if you go to the quests tab you will see yesterday completed progress. Try to complete some from today to make sure everything still works as expected

## Checklist
- [x] Tested the changes locally.
- [x] Reviewed the changes on GitHub, line by line.
- [ ] This change requires new documentation.
  - [ ] Documentation has been added/updated.