the-hideout / tarkov-dev

The official site for tarkov.dev - A web app to track item prices, view trader barters, quests, maps, and much more!
https://tarkov.dev
MIT License
130 stars 48 forks source link

[Enhancement] Search Reset Usernames #919

Closed DysektAI closed 2 months ago

DysektAI commented 2 months ago

Describe the Feature Request

Issue

Observation

Proposed Solution Increase the max character limit to 21 to accommodate the length of TarkovCitizen+UserID format

Source Link For Validation

This works until UserIDs reach 100,000,000 The placeholder text of Between 3 and 15 characters should be retained to display the expected in game username limitations but might cause confusion

Shebuka commented 2 months ago

I think this is quite an edge case and increasing max characters will not solve it. As mentioned in Discor the search itself in Tarkov is limited to 15 characters, so to do a proper search (and not just hit the cached results) we need to remove the TarkovCitizen part and search for just the id.

Also, if you know the full name of the banned player you can just type in the UserID in the search:

Screenshot 2024-04-10 at 11 23 19

Razzmatazzz commented 2 months ago

Shebuka provided a simple workaround, but fortunately the fix is very easy as well as shown in #921

Shebuka commented 2 months ago

Shebuka provided a simple workaround, but fortunately the fix is very easy as well as shown in #921

Nice validation fix with the regex!

But don't we still run in the limit of 15 characters in the actual search on BSG side? Is this working for searching for specific banned and cache miss players?

DysektAI commented 2 months ago

Shebuka provided a simple workaround, but fortunately the fix is very easy as well as shown in #921

Nice validation fix with the regex!

But don't we still run in the limit of 15 characters in the actual search on BSG side? Is this working for searching for specific banned and cache miss players?

I was going to reply but before I could the fix was applied... 🤣 If we can just search relative by userID or redirect to the URL with the ID, why not just allow users to enter anything but secure and handle it on the backend, like stripping the "tarkovcitizen" out if it matches the beginning string, and do as you demonstrated and just query the actual UID instead which seems like is what was done.

I think the only thing that could possibly be improved further is to just redirect directly to the users profile page if results = 1 then tarkov.dev/player/ USERID but that's just being extra... Unless you got a trick up your sleeve to do that also @Razzmatazzz 👀 (May have unintended side affects though causing users to have to go back to the search if they accidentally hit an exact result when trying to search relatively)

Either way solid improvement and good execution from what I can see here! 👍