Recently saw this great post in the community about debugging apps using history offset and thought that it might be helpful to post here since its pretty hidden in the documentation.
@jSims wraps this up pretty well - If you include a component that breaks your app and its hard to delete it due to the app constantly crashing, you could
add ?_historyOffset=10 to the end of your URL which will allow you to "travel back in time" 10 steps. You can increase the number to go further back in time if you still don't see any app data. The idea here is to go back to the most recent working version before the chart so you don't have to redo as much work (i.e. going back 10000 steps would likely work, but it could be many, many changes behind). - @jSims
You could also -
Does anyone else have any schnazzy tricks to debug their apps?
4 Likes
From that post,
WARNING! If you make any changes to the canvas when traveling back in time, that past version will become your present version and it messes with the history, so be careful not to touch anything!
@jSims @Tess This should really be a more prominent warning when doing this...
I learned about _historyOffset here, where it doesn't mention anything about if you make a change, that it becomes the latest version, essentially losing anything that happened between that historyOffset and what was your latest version.
Anyone used to working with branches is likely to think they are just editing the historyOffset=X version and not making changes to the actual latest.
I know it's mentioned here, but I would really put that warning in both places -- and would actually suggest just loading it directly into a read-only view and having a modal or something pop up with that "Any changes made to this version will make it the latest version. We suggest downloading the JSON and importing it into a new app to explore or..." something like that.
Even so, it's still salvageable as you can then go back "1 step" to before you made a change, create a release, then go back again to the offset.
Or automatically create a draft release of offset=0 whenever an offset of >0 is loaded.