PokeNavBot / issue-tracker

Bug reports / feature tracking repository for PokeNav
https://pokenavbot.com
20 stars 4 forks source link

Escaped and unescaped Backslashes create two different poi #582

Open MaxEtMoritz opened 3 years ago

MaxEtMoritz commented 3 years ago

Describe the bug If a Poi name has Backslashes in it, there are two different methods to submit the Poi name:

  1. leave the Backslashes as they are like $create poi pokestop "test\stop" someLatitude someLongitude
  2. Escape the Backslashes like $create poi pokestop "test\\stop" someLatitude someLongitude.

Both Variants create ta Poi with the name being displayed as test\stop, but they aren't recognised as being the same poi, so you will have two poi with the name test\stop. That may be OK if You only use one variant. But the worse part of it is: Users who want to search for test\stop will have to know exactly which variant you have used: $si test\stop will bring up only the first variant and $si test\\stop will only bring up the second one. Why would someone want to escape backslashes? Imagine the scenario that a portal name ends with a backslash: the poi creation command would fail because the final hyphen of the portal name would be escaped by the backslash of the portal name and the Bot would throw an error. To play it safe, i decided to escape all backslashes in portal names, but not every PoGo Player knows about the special status of the Backslash in the Computer world and they will wonder why they can't find the poi with the backslash.

To Reproduce Steps to reproduce the behavior:

  1. $create poi pokestop "test\stop" someLatitude someLongitude and $create poi pokestop "test\\stop" theSameLatitude theSameLongitude

  2. see that two different Poi were created, the title of both Poi being displayed as test\stop.

  3. $si test\stop and $si test\\stop

  4. see that each command will bring up a different Poi.

Expected behavior the second Poi should throw an Error that it already exists. both searches should bring up two poi as result.

Screenshots grafik Note: Discord hides the escaping backslash i used on the second Creation Command. grafik Again the second Backslash is hidden by Discord... grafik This is the scenario i thougt of... again the Backslash at the End of the Portal name is hidden by Discord.

Additional context I am asking because i created an IITC Plugin to send Portal Info to Discord and wanted to play it safe and escape all backslashes in portal names.

dandesousa commented 3 years ago

I will look into this some more when I fix but this looked more like its just that Discord / PokeNav renders backslash escaping rather than return it "raw", since lookup works correctly its really just output rendering

MaxEtMoritz commented 3 years ago

OK so this is intentional then, though the output is not quite Right. But i found a related problem now since i wanted to really create that Test poi with Backslash at the end... and no matter how many Backslashes i put in (tried from one up to four), i was not able to create it. some Backslash keeps escaping the final hyphen and the Bot refuses to create the poi. (I don't really know if there is any portal in the world with a Backslash at the End of the portal name though...) Don't know if i should open a new Issue for this or not...