Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migrate from decommissioned ipfs gateway to new one #11985

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NicolasMassart
Copy link
Contributor

@NicolasMassart NicolasMassart commented Oct 23, 2024

Description

  • adds state migration for users with decommissioned IPFS gateway
  • adds migration tests
  • adds new target gateway (dweb.link) to list and make it replace decommissioned gateway.

Note

this is only a state migration, the user will not have any visible warnings. It will only show the new gateway as selected instead of the decommissioned one if it was in their state.

Related issues

Fixes #11692

Manual testing steps

Feature: Migrate from decommissioned gateway to dweb.link 
  Scenario: Verify non migrated gateway
    Given an installed app that was built before the decommission of https://cloudflare-ipfs.com/ipfs/ (pre ac7978596566f148fa6892940fb5678170ba0351, for latest is 7.32.0)
    When go to security & privacy settings
    And select https://cloudflare-ipfs.com/ipfs/
    Then see "Your current IPFS gateway is down" as decommissioned gateway does not respond

  Scenario: Check migration
    Given the current PR app installed
    When go to security & privacy settings
    Then see "https://dweb.link/ipfs/" gateway selected

Screenshots/Recordings

Before

Simulator Screenshot - iPhone 16 Pro - 2024-10-23 at 22 00 21

After

Simulator Screenshot - iPhone 16 Pro - 2024-10-23 at 22 15 31

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@NicolasMassart NicolasMassart requested a review from a team as a code owner October 23, 2024 20:34
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@NicolasMassart NicolasMassart added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 23, 2024
Copy link
Contributor

github-actions bot commented Oct 23, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e63a16f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/65abdc48-bc14-498e-b4f4-80ec7b1a1ee9

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@legobeat legobeat requested review from a team as code owners October 24, 2024 12:51

export default function migrate(state: unknown) {
if (!ensureValidState(state, 56)) {
// Increment the migration number as appropriate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I think we do not need this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied it from previous migration, looks useful reminder and not doing any arm...

if (decommisionedIpfsGateway === preferencesController.ipfsGateway) {
preferencesController.ipfsGateway = newDefaultIpfsGateway;
}
// Return the modified state
Copy link
Contributor

@tommasini tommasini Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I think we can remove this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

tommasini
tommasini previously approved these changes Oct 24, 2024
Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just left some comments

Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.31%. Comparing base (3b21958) to head (1e00dcf).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11985      +/-   ##
==========================================
+ Coverage   55.12%   55.31%   +0.18%     
==========================================
  Files        1750     1765      +15     
  Lines       39559    39756     +197     
  Branches     4922     4955      +33     
==========================================
+ Hits        21807    21990     +183     
- Misses      16249    16259      +10     
- Partials     1503     1507       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Oct 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) release-7.34.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Status: Review finalised - Ready to be merged
Development

Successfully merging this pull request may close these issues.

Remove decommissioned IPFS gateway from wallet state
4 participants