question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App isn't saving anything

See original GitHub issue

Things to check

  • Have you forced a refresh in your browser (e.g. ctrl+F5 in Chrome/Firefox)?
    • using mobile app
  • Have you made sure the first time buyer option is correct? If you’re unsure, try it both ways
    • yes
  • Have you time-travelled this week? Travelling backwards resets the prices, and therefore you must not put prices in from both before & after the time-travel
    • /no

Describe the bug yesterday the app completely cleared everything you said of me having to delete all reset and now there is nothing saving when I’m putting the prices and all my statistics have gone

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Permalink to your prices Please click the Copy Permalink button and paste it here

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Google Pixel 3XL
  • OS: unsure
  • Browser chrome
  • Version ?

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Hattoffcommented, May 19, 2020

I think this may have something to do with this statement in your scripts.js file in the update function:

  if (!window.populated_from_query) {
    updateLocalStorage(prices, first_buy, previous_pattern);
  }

If someone used a URL to generate a portion of their data, then any new input will never be saved. A simple refresh of the page doesn’t reveal this problem, as the browser will cache data input into these fields. This becomes more evident, however, on mobile devices, as they don’t seem to keep pages persistent, and often force-refresh the browser when users close or leave the application for an extended period of time. I believe this is why some users report this problem intermittently, as though it happens randomly.

To replicate this behavior on PC:

  • Open this copied permalink:

https://turnipprophet.io?prices=109.139.123.321…&pattern=3

  • Edit some values.
  • Hit F5 and note that the values stay in place.
  • Now hit CTRL + F5 and notice that the query was re-loaded and previously entered data was never actually saved.

I believe by updating that if statement on the update function in the scripts.js file to something like the following:

  if (!window.populated_from_query) {
    updateLocalStorage(prices, first_buy, previous_pattern);
  } else {
    updateLocalStorage(prices, first_buy, previous_pattern);
    window.populated_from_query = false;
    window.location.href = window.location.origin;
  }

It should resolve the problem by identifying if a query was loaded from the URL, cache the data loaded, then refreshing the page to strip the query. Thus preventing the browser from force-refreshing the page and reloading the original query.

I cloned the repo and tested this solution and it appears to work, but the page flashes a bit, as the values loaded from the URL are filled in before the data is cached and the page is refreshed. I don’t know how to submit this as a potential solution, and I think a better fix could be implemented, but I could give it a shot if needed. Just let me know? Otherwise, I hope this helps anyone working on this bug.

-Hattoff

1reaction
Tekaohcommented, May 20, 2020

Could you verify that it hadn’t been inadvertently been set to true?

undefined

Undefined as of this morning anyways. If it was somehow set to true when I used the app yesterday, maybe everything was deleted yesterday. But say for example it was true yesterday, would that delete all my save data or just what I entered yesterday?

I’m kind of scratching my head on this one… I started experiencing issues only about a week ago. Before that, everything seemed to work normally. But I’m looking through all the commits for the last week or so and I don’t see anything that might have changed the way data is saved in any meaningful way. Super odd… Gotta dig deeper into them I guess?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't my phone save anything? - Quora
Try giving the STORAGE Permission to the apps and then test it. If it still fails, try clearing the cache and force-stop the...
Read more >
Applications not saving files in Windows 10
Lately I have noticed that certain application are not allowing me to save files. I use MS Paint to scan and save images....
Read more >
iCloud not saving app data - Apple Community
It sounds like app data isn't saved in iCloud. This is something that should be backed up: What does iCloud back up?
Read more >
My app is not saving changed data - Bug - AppGyver forums
My app is not saving changed data · On app launch, it tries to get saved user settings from local storage (Get Record)...
Read more >
I can't save my project. What should I do? - Splice Help Center
Check that your device has enough available storage to complete the export. You can do so in Settings > General > iPhone Storage....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found