e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 32 forks source link

🚑 Clicking on the check mark typically does not confirm the trip #903

Closed shankari closed 1 year ago

shankari commented 1 year ago

Report from a partner

clicking the check mark rarely confirms the trip and turns it blue. Most of the time I and others I’ve heard from need to select another mode and then come back to the mode to then get the labels to change color. Sometimes that doesn’t work and you have to click on the map, change the mode there, and then click on the check.

shankari commented 1 year ago

Pulled data for the partner; they do not have any composite trips. Checked the database, there are only 20 composite trips

>>> edb.get_analysis_timeseries_db().count_documents({"metadata.key": "analysis/composite_trip"})
20

Checking the logs...

shankari commented 1 year ago

ok so this is because all the confirmed trip recreation has been failing with the error

Error while creating composite objects, timestamp is unchanged
Traceback (most recent call last):
  File "/Users/kshankar/e-mission/gis_branch_tests/emission/analysis/plotting/composite_trip_creation.py", line 139, in create_composite_objects
    last_done_ts = create_composite_trip(ts, t)
  File "/Users/kshankar/e-mission/gis_branch_tests/emission/analysis/plotting/composite_trip_creation.py", line 36, in create_composite_trip
    elif "additions" in ct["data"] and ["trip_addition"] in ct["data"]:
TypeError: unhashable type: 'list'

not sure how this has even been working after the updated UI. They should not even be seeing any trips. Are they even seeing any trips?

shankari commented 1 year ago

Ah, the trips show up in the diary. Not sure we have tested diary code after all the survey/label changes since we are currently focusing on the label screen. Should check to confirm that they are only using the label screen.

The fix for this is simple enough - we just need to change to

elif "additions" in ct["data"] and "trip_addition" in ct["data"]:

But before we "pull the trigger", let's make sure that we do in fact have intermediate style trips.

shankari commented 1 year ago

So we supposedly have 133 of these

>>> edb.get_analysis_timeseries_db().count_documents({"metadata.key": "analysis/confirmed_trip", "data.additions": {"$exists": True}, "data.trip_addition": {"$exists": True}})
133

The one that failed was

{'_id': ObjectId('641e110681ae368818a4994a'),

which is the first of these intermediate style trips. The last is from May 3rd, which is consistent with:

Screenshot 2023-05-15 at 6 56 55 PM Screenshot 2023-05-15 at 6 57 21 PM
shankari commented 1 year ago

Looking at different types of confirmed trips:

Ok so all that makes sense. The composite trip migration worked for old-style programs (e.g. masscec) and will not be needed for new-style programs (e.g. vail). This only affects intermediate-style programs, which should only be UPRM NICR and smart commute.

shankari commented 1 year ago

After moving past that issue, I ran into another issue that I noticed with my own trips. I have asked my family and they indicated that this wasn't happening for their trips, which is why I was planning to wait to investigate it.

For me, and for this test user, but apparently not for the rest of my family, the yellow trips don't show up in the label screen but they do show up in the diary screen for the same trips.

@JGreenlee, can you take a look?

  1. see if this happens with your own data
    1. if so, you can just fix it directly there
    2. if not, let's chat about the easiest way for you to access my data for testing
Thu May 11 trips in the diary have yellow labels Thu May 11 trips in the label screen do not have yellow labels
Screenshot_20230515-204713 Screenshot_20230515-204805
shankari commented 1 year ago

Reopen to test and fix the label display in the UI

JGreenlee commented 1 year ago

As long as I have worked on OpenPATH, I have never seen yellow buttons on the label screen. I didn't know we were expecting to.

I believed this was one of the features from the diary screen that was not yet implemented on the label screen.

Since my current task is unifying the two screens anyway, I will take a look and see if I can get the yellow labels to show.

shankari commented 1 year ago

As long as I have worked on OpenPATH, I have never seen yellow buttons on the label screen. I didn't know we were expecting to.

The yellow labels were originally only on the label screen. Its only after I converted the buttons into a directive that they were available on the diary screen. But of course, that was before you joined the project, so you were missing that context....

JGreenlee commented 1 year ago

https://github.com/e-mission/e-mission-phone/pull/972 fixes the discrepancy between diary and label screens.