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] stat / hash function cannot resolve bookmark:// path. #75

Closed
leo6104 opened this issue Oct 5, 2024 · 1 comment
Closed

[iOS] stat / hash function cannot resolve bookmark:// path. #75

leo6104 opened this issue Oct 5, 2024 · 1 comment
Labels
P2 Important issue. Ready Ready for release.

Comments

@leo6104
Copy link

leo6104 commented Oct 5, 2024

Current implementation

  NSURL *url = [ReactNativeFs pathToUrl:filepath error:&error];
  if (error) return [[RNFSException fromError:error] reject:reject];

  BOOL allowed = [url startAccessingSecurityScopedResource];

  @try {
    BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filepath];

Current Behavior

ENOENT: no such file or directory, open 'bookmark://...'

Expect Implementation

  NSURL *url = [ReactNativeFs pathToUrl:filepath error:&error];
  if (error) return [[RNFSException fromError:error] reject:reject];

  BOOL allowed = [url startAccessingSecurityScopedResource];

  @try {
    NSString *resolvedPath = [url path];
    BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:resolvedPath];
@birdofpreyru birdofpreyru added the P2 Important issue. label Oct 5, 2024
@birdofpreyru birdofpreyru added the Ready Ready for release. label Oct 27, 2024
@birdofpreyru
Copy link
Owner

Fixed in v2.29.0.

FYI, it was a notch more difficult then just getting and using url.path, instead entire method implementations had to be re-written using functions operating on the url instances, rather than string paths. Thus, keep an eye for possible regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issue. Ready Ready for release.
Projects
None yet
Development

No branches or pull requests

2 participants