Caching of one selection for all other crops selected later(Browser specific)
While creating a new guide for a crop, we are redirected to a new page where we select the crop and then the crop image is displayed. If we change our mind to make a guide on some other crop and go back to select that crop and then click on creating a new guide, it redirects us to a page, not asking for the crop but it displays our previous selection. This happens even if we login into our account again and we are able to enter our choice only after manually cancelling it.
For example: We decided to make a guide on tomatoes.
Then we selected the option to create a new guide and selected tomatoes on the redirected page.
After that, display image for tomato was on the screen.
But after this step we realised that we wanted to make a guide for cherry tomatoes and decided to go back and selected cherry tomatoes.
After selecting create your guide in cherry tomato, instead of getting an option to choose a crop, we got an image of tomato already selected which was actually our previous selection.
This was resolved only after manually cancelling the selection we had made in the first attempt. This problem is browser specific. Entries are cached in that browser but not in our account.
@simonv3 @roryaronson @sophiakc please do look into it.
@Rupal-IIITD, I think this is happening because the browser is caching a partially completed Guide which we want to do in case you are farther along the guide creation process and your browser crashes or you accidentally close it. Right @simonv3?
Though it doesn't make much sense to cache the Guide if the user has only selected a Crop. Cause that's easy to re-do if the user needs to.
@roryaronson You're right, it might be caching the entries for a partially completed guide, but don't you think that then it should have cached that entry for that crop only. Caching a selected entry for all crops in the farm shouldn't happen ideally. It's apparently not that user friendly if the user has to deselect that cached entry every time he tries to make a guide on some other crop. Isn't it so?
I think once the author completes the guide, the cache is cleared. If you click the "Add Guide" button from another Crop, rather than clearing the cache and starting off with the new Crop, it loads the cache.
Making the cache less aggressive such that it only starts caching if the user reaches a certain point in the Guide creation flow I think makes more sense. A logical point to me to begin caching would be on the Stage Details portion. Once the author has entered stage details then we start caching.
Oh, I also just realized - there used to a be a toast notification that popped up saying something like "Looks like you already started a guide but didn't complete it. We loaded it for you here, but if you want to start from scratch, click here". That notification does not seem to be working anymore which may have helped you have more clarity into the situation.
Ohh okay. You rightly said that it would make more sense if it starts caching if the user reaches a certain point in the Guide creation flow. I would like to add one thing here, as I mentioned earlier, that it should cache entries specific to a crop. Not for all. Well, that sounds something interesting to work on.
Thanks for creating this issue @Rupal-IIITD! I'm going to tag this into #813 so that we're aware of it while considering changes to guide creation.
Sure. I and my teammate, @gargi-gupta will try and solve this issue. Thanks :)
@Rupal-IIITD okay! Can you elaborate on this a bit?
I would like to add one thing here, as I mentioned earlier, that it should cache entries specific to a crop. Not for all.
For example: If a user is making a guide on tomatoes and accidentally closes the tab or loses power supply, then on reopening, the guide created till that point should be present. The user should not make the guide from scratch again. But this caching for tomato should not appear for any other crop. On reopening the tab, if the user wants to make a guide on cherry tomatoes instead of tomatoes, then the saved guide for tomatoes should not appear for cherry tomatoes.
I think this is what @Rupal-IIITD meant to say.
Yeah @gargi-gupta is right! Any suggestions?
So basically if the user is still on step one of guide creation (choosing the crop?), the guide shouldn't be cached?
Yeah you got it right! It should cache the guide only when it is at a certain level of guide creation(after 1st step, of course) and that too only for that crop.
Sounds good to me. While you're in there can you also fix a thing where it's not properly caching nested stages? (kind of just kidding - I haven't debugged this properly, but if you do get around to it, that would be awesome!)
Yes, @Rupal-IIITD and I will definitely work on this.
Yeah! Thanks @simonv3 @roryaronson for your inputs. We will try and work on this.