Skip to content

[FIX] App hanging on splash screen when deep link params are wrong#2359

Merged
diegolmello merged 3 commits intodevelopfrom
fix.hanging-splash-screen
Jul 30, 2020
Merged

[FIX] App hanging on splash screen when deep link params are wrong#2359
diegolmello merged 3 commits intodevelopfrom
fix.hanging-splash-screen

Conversation

@diegolmello
Copy link
Copy Markdown
Member

Proposed changes

As our app answers to https://go.rocket.chat and rocketchat://, we have to follow some rules in order to deep link users to the wanted room or server.
There're some cases that this deep link is wrong, incomplete, with an invalid server, etc.

Previous to this PR, we were just stopping the execution of the process, but that would leave the user stuck on the splash screen, if the app was closed.

This PR checks if the app is opened and, if not, calls appInit(), making the app to start over.

Issue(s)

Closes #1626

How to test or reproduce

Test plan

  • Push notification
  • Deep linking
  • Invite links
  • No host on deep link with the app closed
    • Call xcrun simctl openurl booted rocketchat://room\?WHATEVER\=open.rocket.chat
    • The app should appInit() again
  • No host on deep link with the app opened
    • Call xcrun simctl openurl booted rocketchat://room\?WHATEVER\=open.rocket.chat
    • The app just return
  • Invalid host
    • Call xcrun simctl openurl booted rocketchat://room\?host\=asd.rocket.chat
    • The app should appInit()

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Copy link
Copy Markdown
Contributor

@djorkaeffalexandre djorkaeffalexandre left a comment

Choose a reason for hiding this comment

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

LGTM