LocalStorage should be volatile so that we can clear it between versions. Right now the attachment:index key keeps us from doing this. The data in it is too important to clear between syncs.
Acceptance Criteria
All chatter attachment regression tests should still pass.
Analysis
I would move the data that is being stored in the localstorage for attachment:index to the files DB and create its own store/table called attachment:index which would have all the information that was previously in local storage populated within the new store.
The files that would need to be altered are attachment-picker.js, attachments/list, attachments/store, attachments/sync, and sync/migration – basically any module making calls to grab the attachment:index object.
Need to create a new migration method that takes existing users data in local storage attachment:index and moves it on an upversion.
Related Stories
[alpine_mobile/#5847] Re-architect attachment support
[alpine_mobile/#6039] Update download sync to use Files API
[alpine_mobile/#6054] Update file/attachment upload to use Files API
Tasks
{{ table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD ORDER BY Status }}
Defects
{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}
Impact Analysis
Developers: Fill in this section during code review.
Yes, this card was already tested, merged and accepted. Then we reverted it (sorry Mike) and reimplemented it, with modifications, on top of #6054 & #6039. So it needs to be tested again.
This card was done as part of Feature card [alpine_mobile/#5847] Re-architect attachment support
This only affects File attachments, not report attachments.
From version 3353 to this PR, Bi-weekly to this PR, AND any other version to this PR (see original test plan below)
Technical Details (extra credit):
localStorage: should contain an entry “attachment:index”
IndexedDb: inside of FileStore should only be the table, “files”
Go offline
Using existing Job & Ticket, add Files to both
Go back online
Using existing Job & Ticket, add Files to both
DON’T SYNC YET
Create new Job & Ticket
Add Files to both
Change to this PR (upversion)
Sync
Technical Details (extra credit):
localStorage: “attachment:index” should be gone
IndexedDb: inside of FileStore should be a new table called “attachmentIndex” (in addition to the existing table “files”)
This should complete the main testing for 6080 (again see original test plan below)
Now test
6054
Repeat steps above (minus upversion) starting with “Go offline”
6039
This needs regression testing for all file attachment situations.
SyncToMobile, Upload Files (Online and Offline), Attachments on new jobs/tickets and existing jobs/tickets, and any other scenarios involving attachments as this PR changes where the attachment index is stored.
Test this on upversions as well (From version 3353 to this PR, Bi-weekly to this PR, AND any other version to this PR). We want to ensure users do not lose any information whether migrating from the default version as well as any other version the user may be on. Existing users should not lose any existing data but instead, it should be relocated from local storage to indexedDB. Test the upversion after creating new jobs and adding attachments as well as existing ones and adding attachments (both offline).
While on the Beta, I created file attachments for Job and Ticket objects > Performed an Upversion to PR2981, and Verified that attachmentsIndex are now stored in the IndexedDB
While on the PR, I performed a smoke test in mobile and verified that file attachments still works for correctly for new jobs/tickets and existing jobs/tickets
Mingle Card: 6080 Narrative
LocalStorage should be volatile so that we can clear it between versions. Right now the attachment:index key keeps us from doing this. The data in it is too important to clear between syncs.
Acceptance Criteria
All chatter attachment regression tests should still pass.
Analysis
I would move the data that is being stored in the localstorage for attachment:index to the files DB and create its own store/table called attachment:index which would have all the information that was previously in local storage populated within the new store.
The files that would need to be altered are attachment-picker.js, attachments/list, attachments/store, attachments/sync, and sync/migration – basically any module making calls to grab the attachment:index object.
Need to create a new migration method that takes existing users data in local storage attachment:index and moves it on an upversion.
Related Stories
[alpine_mobile/#5847] Re-architect attachment support
[alpine_mobile/#6039] Update download sync to use Files API
[alpine_mobile/#6054] Update file/attachment upload to use Files API
Tasks
{{ table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD ORDER BY Status }}
Defects
{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}
Impact Analysis
Developers: Fill in this section during code review.
Test Plan
NOTES
Test it...
6080
6054
6039
This needs regression testing for all file attachment situations.
SyncToMobile, Upload Files (Online and Offline), Attachments on new jobs/tickets and existing jobs/tickets, and any other scenarios involving attachments as this PR changes where the attachment index is stored.
Test this on upversions as well (From version 3353 to this PR, Bi-weekly to this PR, AND any other version to this PR). We want to ensure users do not lose any information whether migrating from the default version as well as any other version the user may be on. Existing users should not lose any existing data but instead, it should be relocated from local storage to indexedDB. Test the upversion after creating new jobs and adding attachments as well as existing ones and adding attachments (both offline).
QA Test Analysis:
https://lfw.testrail.io/index.php?/cases/view/4827
https://lfw.testrail.io/index.php?/cases/view/4828
https://lfw.testrail.io/index.php?/cases/view/18900
Before the Pull Request
!clip-088b-b820.png!{height: 411px; width: 1000px;}
After The PR
!clip-560b-a756.png!{height: 451px; width: 1000px;}