jaybo / deepzoom-blog

Public repository for DeepZoom
0 stars 0 forks source link

Lost marker & route #7

Open TangoFan opened 2 years ago

TangoFan commented 2 years ago

I just created a marker and then a route a few minutes ago. After relaunching Deepzoom they no longer exist.

jaybo commented 2 years ago

Were you logged in? Did you save the trip?

TangoFan commented 2 years ago

Pretty sure. I'll try it again soon. Is there any diagnostic info I could provide?

jaybo commented 2 years ago

Every time you save a trip, there will be feedback in the form of a quick message appearing at the top of the screen which says: "Save succeeded". Are you seeing this message?

TangoFan commented 2 years ago

With trips I do see Save (although the one I created seems to have disappeared). What about Routes and Markers? Frankly, my experience so far is that none of these stay persistent once the browser closes (sometimes by accident).

jaybo commented 2 years ago

Regarding markers:

Originally, private markers were only saved in the current trip. This design wasn't at all flexible.

So, I've been spending most of the summer reworking markers from the ground up, adding text, images, and videos to both private and public markers as well as trips. Groups of markers can have user defined names and can be shown or hidden as a group. One or more groups of markers can be associated with a trip. Apologies for not having this working yet, but it's proven to be a bit of an ordeal. I'm anticipating having a beta availability around the end of September.

The situation with tracks is slightly more dismal. The support for background GPS recording is currently at draft status: https://w3c.github.io/geolocation-sensor/ so it will be a while until full GPS support is a reality.

Cmjstealth commented 1 year ago

I spent part of the day creating a number of markers for dive sites I want to visit this year. I got an error message when trying to save marker comment the first time (didn't catch the error code and couldn't reproduce) but all attempts after that to save new markers, add comments, and images after that seemed to be working fine. Each time I added a comment it would briefly say docAppend succeeded.

Later when opening a new browser window everything was gone. They also arn't there on my phone. I still have the original window open so I can actually share screenshots of both. I'm logged in for both examples.

Markers working markers gone

Cmjstealth commented 1 year ago

It just occurred to me that maybe this is a usability issue? I never understood what the trips tab was for - been ignoring it for years and always going straight to the route, tides, and weather tabs. Is it that all routes, markers, etc are always members of separate "collections" which are labeled trips? I always assumed a trip was just another flavor of a route with bulk import/export functionality. After creating some markers and then going to the trips tab I tried using the save button. First time it said "request failed with status code 401" but the second attempt appeared to work. Now for the first time ever I seem to be able to access previously saved markers from a different browser window or device!!! Whoa... fireworks R

Some thoughts if this is the intended design... I'm not sure it is clear to many people that markers, routes, etc only save if they are saved as part of a "trip". From a users perspective the visual layout doesn't imply any hierarchy between trips and its component parts - they look like independent tabs. If a user goes straight to the routes or markers tab and starts creating things it also appears like things are working and that the app is saving all changes as you go (this is, after all, how most apps that users are familiar with function - example: google maps). There also doesn't appear to be any indication on the routes/markers tabs that the user has unsaved data that might alert them to the fact that things need to be saved as part of a trip collection. It also isn't necessarily intuitive to users who's use cases arn't "trip-like". For example simply checking weather at a particular site, browsing through current predictions to see where would be good places to go, looking up something on marine maps, or checking the distance between two points are all use cases that can occur in isolation. Items like markers can also be relevant across multiple trips.

just brainstorming... but I think the site already creates a blank placeholder trip "collection" when the app is opened, no? If it were to save automatically with each change and the default trip was always re-opened on subsequent visits would this be an easy way to address most of this? Especially if trips were renamed and/or moved to look different than the other tabs so the structure was more clear?

Nothing here is meant as criticism by the way :-) Just an awkwardly unsolicited brainstorm on the off chance you find something useful. I find deepzoom an incredible valuable tool and use it on an routine basis. You have built something so wonderful here that I can't help but want to speak up and help it prosper.

jaybo commented 1 year ago

Great feedback, thanks!

First a question about the error messages: Were you logged in at the time you were getting these errors?

Trips. Yes. Everything gets saved in a trip. When you save a private marker without saving a trip which contains the marker, the marker data gets saved, but the reference gets lost. Oops.

I already went down the path of having groups of private markers separate from a trip, but the UI became ponderous. You'd want the ability to add/subtract each and every marker from each and every group. Naming and renaming groups. Add/subract groups from a trip.

The grand simplification is to put markers into a trip. But this only makes sense if you can then merge trips which unfortunately is as yet an unimplemented feature. Oops.

Your idea to auto-save the unsaved trip only works if the user is logged in. But it's a great suggestion and I plan to implement this. Some tricky issues if you have multiple browsers open simultaneously... who wins?

(Aside, I just noticed the code that auto-saves and restores the current state of an unsaved trip (to localstorage, not the cloud) whether or not you're logged in broke at some point in the past. I just fixed this, so your markers and routes should survive a browser refresh in the future).

Cmjstealth commented 1 year ago

Yes I was logged in during all 3 of the most recent times I've gotten an error. Once when saving a simple text comment, once when saving a image in a comment (without text), and once when saving a marker. I'm unfortunately unable to reproduce any of these examples. In each case simply attempting to save again, even in the same way with the same content, seemed to work.

jaybo commented 1 year ago

Can you estimate the time interval between these 3 error events? Were these all on the same device? Same browser?

I think the source of the issue is in a refeshToken which gets saved locally and updated periodically. I just added a check to make sure the token refresh completes before other requests to the server are issued, so hopefully this will fix it.

jaybo commented 5 months ago

Hi Cmjstealth. You can now add your SCUBA markers to the public map:

https://www.deepzoom.com/add-public-markers

After adding your private markers to the public map, they will still exist in your original trip. The private markers will always appear larger and overlay the corresponding public versions. Both versions share the same marker content, so if you add your private markers to the public map, any changes you make to the content will appear both on everybody's public version, and also in your private version.

I've tested contributing adding 50 markers at a time without issues, but haven't extensively tested markers with lots of content, so please let me know if you encounter any issues.

Thanks, Jay