-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Building our chat app, I found interesting bug: spaces in usernames in messages sent from flutter client appear as plus signs. But when the same messages were loaded from history, usernames showed normally.
Here is the demo https://github.com/vikmind/pubnub_meta_demo (I used fork from #24 in the demo to load history with meta and to show the difference. The issue with messages from subscription does not depend on it)
Looks like the problem lies in the encoding differences when sending message to PubNub REST API, meta info goes into query part of the URI and dart client is encoding it according to spec.
I assume that transmitting server is interpreting it as URI component, where encoding is slightly different. My assumption is confirmed by the fact that JS SDK use encodeURIComponent for building query component. That's why such problem does not exist there.
So basically, dart sdk uses correct but different (from server and js sdk) encoding when sending additional parameters to REST API. And I am not sure where it should be patched 🤷
