[x] @robinlopez to provide Figma Mockup for the workflow
[x] @fcamblor & @robinlopez to agree on the workflow
[x] @robinlopez to provide Voxxrin screens integration of the mockup
[ ] @fcamblor to implement import/export scenario based on @robinlopez integration
[x] Delete all users : those with last-connection-date older than T-7m AND total-favorites = 0
[x] Migrate user model to version:3 to merge version:1 and version:2 + Not letting "empty" space/event/day/talkNotes entries as we need to be able to "browse" them from the frontend app
[ ] Fill /exported-data/{secretToken} from mobile app's backuped data
[ ] Server side, on /exported-data/{secretToken} creation, delete any other entry belonging to current user (current user can only have a single entry here)
[ ] Generate QRCode on device A
[ ] Show previous QRCode on device A if there is an /exported-data/ already there for current user (should store its id in localstorage I guess)
[ ] Provide a screen to scan QR Code on Device B
[ ] Read and load data from /exported-data on Device B, handling duplicates/merges properly
[ ] CRON google function to daily clean outdated /exported-data entries (older than 24h)
Story description
Given that we don't have any authenticated account (yet), we should allow users to share his personal users/{userId}/* data from one device to another.
Workflow :
[On Device A]
User on Device A goes to his user preferences an click Import/Export button
On the screen, he has a button allowing him to initiate an export workflow on his device
By clicking it, it will generate a /import-export/{secretToken} document with secretToken being generated on Device A :
{"expires": "{ISO Datetime of T+24h}", "initiatedByExporter": "{currentPublicUserId}" }
This new collection should have following properties :
User should only be able to create a collection with those properties set. initiatedByExporter shouldn't be allowed to be filled with something else than current (public) user's id (which should be retrieved in its private space)
Collection should obviously not be listable
Anyone knowing a valid secretToken should be able to read its content
Serverside function should enforce that when an import-export document is created for a user, any other existing import-export document belonging to this user should be deleted
Once done, we should allow to copy an import URL looking like https:///user/initiate-import?secretToken=. Ideally, it would also be nice to provide a QRCode opening this same URL from another device.
We should show a "Waiting for other device to connect..." to the user
[On Device B]
Scenario 1 : initiate import from URL
User on Device B opens the URL shared with him, it should bring him to an "Initiating import..." screen
Scenario 2 : initiate import from manual token
User on Device B navigates to Import/Export user preferences screen, and initiate an "Import workflow through manual token" on his device
A modal is opened, asking for the secret token, then navigating to "Initiating import..." screen
Scenario 3 : initiate import by sharing current exporter
User on Device B navigates to Import/Export user preferences screen, and initiate an "Import workflow through importer's QR Code"
This should generate a /import-export/${secretToken} entry, the same way I described it on Device A above, except that document will look like this (replace initiatedByExporter field by initiatedByImporter) :
{"expires": "{ISO Datetime of T+24h}", "initiatedByImporter": "{currentPublicUserId}" }
We should show a "Initiating import..." screen, with a QR Code (and have a corresponding scenario than current one, but on exporter's side)
Scenario 4 : initiate import from exporter's QR Code
User on Device B navigates to Import/Export user preferences screen, and initiate an "Import workflow through exporter's QR Code"
This opens a QRCode scanner aimed at scanning QR Code generated on exporter side, then bring user on "Initiating import..." screen
From here, user should have shared secretToken between 2 devices
Second device should add a property telling that it has joined the firebase collection
Once this property appears, then exporter device should "dump" all user collections into the import-export document
Once this dump is achieved, importer device should retrieve this data, and integrate it into current user's profile
Taking care of duplicated data (tokens, favorites etc.) with importer device
Once importer has finished the job, he should delete the firebase document and show a "completed" message
Once exporter detects the firebase document has been deleted, he should show a "completed" message also
We should also plan to have a CRON function triggered every day, allowing cleanup import-export documents with outdated expires property
Progress
last-connection-date
older than T-7m ANDtotal-favorites
= 0/exported-data/{secretToken}
from mobile app's backuped data/exported-data/{secretToken}
creation, delete any other entry belonging to current user (current user can only have a single entry here)/exported-data/
already there for current user (should store its id in localstorage I guess)/exported-data
on Device B, handling duplicates/merges properly/exported-data
entries (older than 24h)Story description
Given that we don't have any authenticated account (yet), we should allow users to share his personal
users/{userId}/*
data from one device to another.Workflow : [On Device A]
Import/Export
buttonBy clicking it, it will generate a
/import-export/{secretToken}
document withsecretToken
being generated on Device A :This new collection should have following properties :
initiatedByExporter
shouldn't be allowed to be filled with something else than current (public) user's id (which should be retrieved in its private space)secretToken
should be able to read its content[On Device B]
Scenario 1 : initiate import from URL
Scenario 2 : initiate import from manual token
Import/Export
user preferences screen, and initiate an "Import workflow through manual token" on his deviceScenario 3 : initiate import by sharing current exporter
Import/Export
user preferences screen, and initiate an "Import workflow through importer's QR Code"/import-export/${secretToken}
entry, the same way I described it on Device A above, except that document will look like this (replaceinitiatedByExporter
field byinitiatedByImporter
) :Scenario 4 : initiate import from exporter's QR Code
Import/Export
user preferences screen, and initiate an "Import workflow through exporter's QR Code"From here, user should have shared secretToken between 2 devices
We should also plan to have a CRON function triggered every day, allowing cleanup import-export documents with outdated
expires
property