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

iOS Linking escapes hash's #28508

Closed
ManAnRuck opened this issue Apr 3, 2020 · 7 comments
Closed

iOS Linking escapes hash's #28508

ManAnRuck opened this issue Apr 3, 2020 · 7 comments
Labels

Comments

@ManAnRuck
Copy link

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

When I try to link with import { Linking } from 'react-native'; an url with # on iOS the safari opens the url escaped with %23 instead of #.
for example https://www.democracy-deutschland.de/#!engineering#help opens in safari https://www.democracy-deutschland.de/%23!engineering%23help

React Native version:

System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
    Memory: 940.02 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 22, 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.3
      System Images: android-26 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-R | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  npmPackages:
    react-native: 0.61.4 => 0.61.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Steps To Reproduce

  1. Linking an url with some #
  2. check opened url in safari

Expected Results

do not escape by Linking library. or add options to handle this

Snack, code example, screenshot, or link to a repository:

https://github.com/demokratie-live/democracy-client

@stale
Copy link

stale bot commented Jul 11, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 11, 2020
@ManAnRuck
Copy link
Author

Backlog

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 13, 2020
@stale
Copy link

stale bot commented Oct 12, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 12, 2020
@rayliao
Copy link

rayliao commented Nov 2, 2020

I got same issue

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 2, 2020
@rayliao
Copy link

rayliao commented Nov 3, 2020

can fix by using encodeURI

@cipolleschi
Copy link
Contributor

We recently landed 2b4e1f5 that should fix the issue.

@cipolleschi
Copy link
Contributor

We had to back out the changes due to some internal tests failing.

cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 18, 2023
Summary:
This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Differential Revision: D45078923

fbshipit-source-id: 97f417bbad086df1d16dbf509e7bf49f6f745583
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 23, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: b7154302260304291b09be5d5e7a0d43e0514ed3
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 23, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 0f29e94523c35e97c86daf7d710c599363d56352
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 24, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 94e882e797db879c4f1be24d163817aa60ef3776
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 24, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: a09e434ac1365949f1a738c9c17111a92d55677b
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 25, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 6daac460dd4424131341d18c400a39ce2b605436
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 25, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 3e6cbd0c0532e85c31fb0b7aa3ab3cef1c5c6f6c
cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 25, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 2796d175ac21befc49afd1b940d5c2a0c93ed00b
jeongshin pushed a commit to jeongshin/react-native that referenced this issue May 7, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 010a5c173784f8341a1a08bcbd06a6ad14299c75
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this issue May 22, 2023
Summary:
Pull Request resolved: facebook#36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](facebook@2b4e1f5).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix facebook#28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 010a5c173784f8341a1a08bcbd06a6ad14299c75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants