Cache Remains and Crash the New Project
munusshih opened this issue · 7 comments
Describe the bug
The new project might constantly crash and the whole site will go blank if you try to interact with it. This is probably caused by the remaining local storage cache. Since you have opened another project and interacted with the sidebar before in the custom preset, it remembers the cache will crash your new project that has the same project name or function name (unsure) if the parameters don't match.
To Reproduce
Steps to reproduce the behavior:
- Go create and run dev for any project using the default project name and function name
- Play with its sidebar in the custom preset
- Close this first project
- Now create another project using the default project name and function name in a different folder
- Play with its sidebar in the custom preset
- See the error
Expected behavior
The site will go completely blank with error messages in the console stating that some of the sidebar values are null
Screenshots
Screen.Recording.2022-05-25.at.2.45.10.PM.mov
Desktop (please complete the following information):
- OS: MacOS
- Browser: chrome
- Version: 2.0.0-beta.7
Additional context
Local Cache Memory Related.
Hey @munusshih ! Could you please share at least part of the erros stacks that you get with this?
Also, I think you added the incorrect video.
@munusshih I was able to recreate an error. Not with the DSI logo maker though, but with same named functions in different projects. Can you specify the name of the functions you interacted with in DSI logo maker and in the new project? Because from what I remember, the name of functions should be enough to tell local storage apart. If they are called differently, maybe the issue was with another project, or it's another issue all together.
@fdoflorenzano Thanks for pointing that out. Lemme update my post.
No come to think of it I name all of them with the default project name my-project
and default function name my-function
but in different folders. Maybe that's why?
@munusshih Unless you also find that somehow using the DSI maker project before affected the run, it may be just that. If you can post the error stack in a comment either way, I would appreciate it.
I've done some different combinations and surprisingly was unable to recreate the error even with the same function name in different folders.... but these are the error stacks
- The above error occurred in the component
- Uncaught TypeError: Cannot read properties of undefined (reading "hasOwnProperty")
This could really be about the same function name. The function name is used to generate the params' cache key in localStorage. So you could run in situations where mechanic loads an incompatible version of the cached params into a function that has the same name as the function that cached those values.
If this is the cause of this #140 should fix it 😊