Guest User

Untitled

a guest
Apr 21st, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Changes that I implemented for the data reset stuff.
  2.  
  3.  
  4. Changes to /addon/setup
  5.  
  6. If data needs to be reset, it returns:
  7.  
  8. { success: false, reason: 'reset-required' }
  9.  
  10.  
  11. Changes to /addon/push
  12.  
  13. If data needs to be reset, it returns:
  14.  
  15. { success: false, reason: 'reset-required' }
  16.  
  17.  
  18. When the above happens, you have to stop collecting data (stop the engines), reset the add-on state (except username/password) and then call the /addon/reset method.
  19.  
  20. The /addon/reset method needs the same POST data as /addon/setup:
  21.  
  22. { version: 1 }
  23.  
  24. It will reset data immediately and then clear the internal reset-required flag for the user.
  25.  
  26. The add-on can now do its initial upload as usual.
  27.  
  28.  
  29. To test this, connect to mysql:
  30.  
  31. mysql --user=fxhome --password=fxhome fxhome
  32.  
  33. select id from users where username = 'max@mozilla.com'; // replace with your account name
  34.  
  35. insert into UserProperties (user_id, name, value) values (your user id, 'reset-required', 'true');
  36.  
  37.  
  38. Let me know if you have questions.
  39.  
  40. S.
Add Comment
Please, Sign In to add comment