Giter VIP home page Giter VIP logo

Comments (24)

ShayAdler avatar ShayAdler commented on July 19, 2024 2

So from a very quick glance, this is not a real backend problem, but a problem with how we query the data.
If you take a look at the requests in the network tab, you'll see that we don't filter well on the dates, which results a duplication of rides, and therefore of stops:

  • https://open-bus-stride-api.hasadna.org.il/gtfs_routes/list?limit=100&date_from=2023-10-18&date_to=2023-10-19&operator_refs=4&route_short_name=364 -> returns 6 results (2 routes of each line ref). The reason for that is that think the gtfs data is generated per day (in the MOT servers, as well as in the backend, because the planned routes can change)
  • Therefore 2 rides are queried (1 for the 18.10, one for the 19.10), and this is why we get the stops duplication:
Screenshot 2023-10-19 at 12 15 12

from open-bus-map-search.

ShayAdler avatar ShayAdler commented on July 19, 2024 2

@ArkadiK94 , looks great, I think you can close 🙏 😄

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024 1

filter out results with the same ID sounds like a good idea
image

from open-bus-map-search.

ArkadiK94 avatar ArkadiK94 commented on July 19, 2024 1

ok, I re-opened it for now, let's wait the response of @ShayAdler if there is required a change in the back-end as well

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

It happens on many bus lines.
Though each entry presents you with different times and only the name is duplicated, I think it will be a good idea to merge those duplications to just one entry containing all the different times.

I believe it's worth doing on the backend, that will just return the data as we want it.
But if it's not possible you can assign the issue to me and I'll make a helper function to manipulate the data on the front end.

from open-bus-map-search.

shootermv avatar shootermv commented on July 19, 2024

totally agree that it better be done at backend...
may be it is worth to open issue there

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

Okay, so let me know if I should work on it on the front or not 😄
Maybe I can take a look on the backend myself and see if I can make this modification there

@NoamGaash what do you think?

from open-bus-map-search.

shootermv avatar shootermv commented on July 19, 2024

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

Okay, I'll take a look there and get back to you Sunday/Monday with my thoughts

from open-bus-map-search.

shootermv avatar shootermv commented on July 19, 2024

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

AFAIK, there are subtle differences between both variations
@ShayAdler wdyt?

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

So given the new info, what do we want to do about this issue?

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

Awesome, I'll take a look over it ;)

from open-bus-map-search.

ShayAdler avatar ShayAdler commented on July 19, 2024

@NoamGaash is there a reason not to query only the actual date the user filtered on? This will solve the issue..
This bigger range selection sounds buggy for another reason - what if I searched for the 18.10, and this route does not exsit in this date, but is does exist on the 19.10? Currently, I'll see it in the search results

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

you're right, it will be a better solution

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

Perfect, so I have my task.
I'll go over the code and get to it.
Will update you soon

from open-bus-map-search.

Pafestivo avatar Pafestivo commented on July 19, 2024

so i took a deeper look on that issue, and it doesn't seem related to the dates.
i logged what i got back from the server and saw this:
image
they are all the same dates, only difference is the route key(look at the last two characters of the key of each duplications)
i can't really put my finger on why we get those duplications. will you be able to take a quick look?
here is the example of the data i tried to query on the frontend:
image

waiting on your response <3 @NoamGaash @ShayAdler Thanks!

from open-bus-map-search.

ArkadiK94 avatar ArkadiK94 commented on July 19, 2024

@NoamGaash I close this issue, the discussion about this issue continues in issue #176

from open-bus-map-search.

AdlerShay avatar AdlerShay commented on July 19, 2024

Hi, @ArkadiK94 you sure this is the same problem? My issue is trying to better handle a by-design case, while this is an actual bug.

from open-bus-map-search.

ArkadiK94 avatar ArkadiK94 commented on July 19, 2024

Yeah, @Pafestivo wrote that the difference between the routes is only the key one with # while the other with number. Which indicates that there are two routes with the same "from destination" and "to destination". Maybe, I am wrong tell me if so , and I will reopen this issue.

from open-bus-map-search.

ArkadiK94 avatar ArkadiK94 commented on July 19, 2024

I am sorry, the issue talks about two different routes where here the bug is about duplicated stops. As a result, I am not sure if it is the same issue so I will reopen it for now. @ShayAdler @AdlerShay

from open-bus-map-search.

ShayAdler avatar ShayAdler commented on July 19, 2024

@ArkadiK94 yep this is definitly confusing 😅 , but I still think this is not the same issue. The diff is that in #176 , the line_ref is different (in gtfs, each direction of the line gets a different line_ref, so for exmaple the same line 37 from Tel Aviv to Yehud does not have the same line ref as from Yehud to Tel Aviv, the same goes for "halufot").

Here are you can see, it is the same (as well as the route_long_name and route_mkt, but the dates are different.
I have not deeply investigated the pattern with the "#", but I guess that this line can sometimes have other halufot.
Let me know if it is still unclear :)

image

from open-bus-map-search.

ArkadiK94 avatar ArkadiK94 commented on July 19, 2024

@ShayAdler @NoamGaash Do you want this issue to be still open to make the relevant changes in the backend? Or is the filter in frontend is enough?

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

@ArkadiK94
I'm not sure, feel free to re-open

from open-bus-map-search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.