Smashing / smashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
https://smashing.github.io/
MIT License
3.22k stars 324 forks source link

Refreshing browser removes widget data until next data push #176

Open qthatswho opened 3 years ago

qthatswho commented 3 years ago

Describe the bug Refreshing the browser window removes widget data until the next data push from the jobs. This did not occur in Dashing.

To Reproduce Steps to reproduce the behavior:

  1. smashing start
  2. load the dashboard in a browser
  3. post data to the widgets from a dashing job
  4. Refresh the browser page
  5. Note that data no longer shows in widget (specifically in my case, the Number widget)

Expected behavior Previously data posted to a widget should persist through a browser refresh

Desktop (please complete the following information):

Additional context it''s common during development to need to refresh the dashboard HTML a lot, and often times the jobs will not run for quite a while, and it can be unnecessarily taxing to re-run some of the jobs just to fill back in the data to test the changes to the view.

kinow commented 3 years ago

Hi @qthatswho good issue description thanks. I think in Dashing it really persisted the data for a while. I will have to try to reproduce it, and then debug. But I remember the history data is kept in a local file in the server, so I expected the latest data to be displayed when refreshing the browser.

qthatswho commented 3 years ago

Yes, I recall there was some sort of local cache/history file used by Dashing. Is there not a similar mechanism in Smashing? This should be pretty easy to repro.

kinow commented 3 years ago

I think the file is still created. Probably some coffeescript or ruby code changed, and caused the issue. Will try to reproduce it today :+1:

qthatswho commented 3 years ago

I will add, the widgets where I'm seeing this most reliably are widgets I copied directly from Dashing (pretty basic clones of the Number widget with simple alterations). Not sure if there were any changes in Smashing that might require updates to widgets to properly cache history data.

kinow commented 3 years ago

Trying to reproduce. Installed the gem from master.

My environment:

OS: Ubuntu LTS 20.04
Browser Firefox 84.0.1
Version `master`, which is really similar to `1.3.0`, the latest version
Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

@qthatswho did I miss anything? Here's a GIF showing what I'm seeing.

GIFrecord_2021-01-08_152023

qthatswho commented 3 years ago

Been playing with this more. It may be some strange interaction with the layout in concert with another widget (text) on the same row. I ended up duplicating the board and laying it out with the affected widgets (same widget type) all on their own row, and that board refreshes fine. Will update if I can figure out what the difference is where I am reproducing)

qthatswho commented 3 years ago

Ok, I figured out the difference, I think. On the board where I am able to reproduce, I am updating the Number-esque widgets "subtitle" data-binding (which I had to add in the cloned version of the widget I am using), and when I comment out the send_event for that, strangely, everything refreshes fine and the data persists. The board where this was all working never had the subtitle being updated, so that jives with this theory.