Closed usame-algan closed 1 year ago
CLA Assistant Lite All Contributors have signed the CLA.
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
Type | Occurrences | Fixable |
---|---|---|
Errors | 0 | 0 |
Warnings | 0 | 0 |
Ignored | 0 | N/A |
Report generated by eslint-plus-action
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/routes/export/Export.tsx | 0 | 1 | 0.0% | ||
src/routes/index.tsx | 0 | 1 | 0.0% | ||
src/routes/safe/components/Settings/DataExport/index.tsx | 0 | 12 | 0.0% | ||
<!-- | Total: | 1 | 15 | 6.67% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/components/PsaBanner/index.tsx | 8 | 0% | ||
<!-- | Total: | 8 | --> |
Totals | |
---|---|
Change from base Build 3408444922: | 0.03% |
Covered Lines: | 4778 |
Relevant Lines: | 10421 |
Can't we just do a simple JSON.stringify(localStorage)?
~I think it depends on where we want to parse the data. In the future we want to support export and import in web-core so we would have to parse the old format there as well. If we parse it here into the web-core format the implementation there could be more simple. Wdyt?~ Lets export everything so we don't have to release a new version if we decide to extend it. We also already have the parsing functions in web-core.
Can't we just do a simple JSON.stringify(localStorage)?
Although this is a simple approach, it will export a lot of unnecessary data and we'd have to parse it in web-core
.
Lets export everything so we don't have to release a new version if we decide to extend it. We also already have the parsing functions in web-core.
~The added Safes are stored differently in the localStorage
in safe-react
so we can't use the migration logic we have in place as well.~
I think the users should be able to just take all their data out.
The added Safes are stored differently in the localStorage in safe-react so we can't use the migration logic we have in place as well.
Not sure what you mean. As Usame said, we do the same kind of migration via an iframe.
Not sure what you mean. As Usame said, we do the same kind of migration via an iframe.
This can be disregarded. The Redux store uses Immutable.js for the added Safes but it looks like there is separate initiation logic outside of our "standard" persistence implementation for added Safes (loadSafesFromStorage
).
Something I realized while giving adhoc support on exporting: it’s not easy to link to a safe-specific route. I suggest we additionally create an /export route for this feature. Similar to /welcome. The local data isn’t safe-specific.
Something I realized while giving adhoc support on exporting: it’s not easy to link to a safe-specific route. I suggest we additionally create an /export route for this feature. Similar to /welcome. The local data isn’t safe-specific.
An /import
route could also be beneficial on web-core
as it imports the entire app data.
What it solves
Part of https://github.com/safe-global/web-core/issues/1097
How this PR fixes it
/export
that contains the same button.json
file is versioned with version1.0
and contains adata
key with thelocalStorage
dataHow to test it
.json
file being downloaded that contains the localStorageScreenshots