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

[Nearby Connections] error occurred when trying to send a file containing Non-ASCII values #2343

Open
youngmin-gwon opened this issue Mar 15, 2024 · 3 comments
Labels
lang: swift An issue with a Swift client library P1 Priority 1 issue (will likely block a customer in the future) platform: apple An issue with the macOS or iOS implementation project: common An issue with the Nearby common code project: connections An issue with the Connections project type: bug Something is broken or not working as intended

Comments

@youngmin-gwon
Copy link

Project

Nearby Connections

Language

Swift

OS Platform

Apple

What happened?

When sending a file with Non-ASCII name(e.g. Hiraganaひらがな.txt, Cyrillicкириллица.txt, or !@#.png) after connection, iOS app failed to send a file. There are two cases depending on whether file URL is percent-encoded or not.

  1. Nothing is sent when the file name is percent-encoded.
  2. Null pointer exception throws when the file name is not percent-encoded

Oh, I made URL instance using URL(fileURLWithPath: path) constructor.

What did you expect to happen?

I expected to send a file payload to connected endpoint.

How can we reproduce it (as minimally and precisely as possible)?

  1. Name any file to a name containing text with [^0-9a-zA-Z] (e.g. Apple애플.png, !@#.png, etc.)
  2. Make URL instance indicating this file with
let url = URL(fileURLWithPath: "this file path")
  1. Make connection with other device. (In my case, it does not matter whether the opponent is Android or iOS device)
  2. Send file payload using
connectionManager.sendResource(at: url, withName: "any-name", to: [endpointId], id: payloadId) 

How often does this bug happen?

Every time

Standalone code to reproduce the issue

the iOS Example with some modification(sendResource) would work. Please let me know if you are not being able to reproduce it.

Relevant log output

No response

Anything else we need to know?

  • I only tested this using point-to-point strategy.
@youngmin-gwon youngmin-gwon added needs-triage Issue still needs to be assigned, labeled and deduplicated type: bug Something is broken or not working as intended labels Mar 15, 2024
@bourdakos1 bourdakos1 added P1 Priority 1 issue (will likely block a customer in the future) platform: apple An issue with the macOS or iOS implementation lang: swift An issue with a Swift client library project: connections An issue with the Connections project project: common An issue with the Nearby common code and removed needs-triage Issue still needs to be assigned, labeled and deduplicated labels Mar 15, 2024
@bourdakos1
Copy link
Collaborator

Thanks for reporting! I'll take a look :)

@justzh

This comment was marked as spam.

@justzh

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: swift An issue with a Swift client library P1 Priority 1 issue (will likely block a customer in the future) platform: apple An issue with the macOS or iOS implementation project: common An issue with the Nearby common code project: connections An issue with the Connections project type: bug Something is broken or not working as intended
Projects
None yet
Development

No branches or pull requests

3 participants