Skip to content

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

@youngmin-gwon

Description

@youngmin-gwon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 issue (will likely block a customer in the future)lang: swiftAn issue with a Swift client libraryplatform: appleAn issue with the macOS or iOS implementationproject: commonAn issue with the Nearby common codeproject: connectionsAn issue with the Connections projecttype: bugSomething is broken or not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions