Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing browser removes widget data until next data push #176

Open
qthatswho opened this issue Jan 7, 2021 · 7 comments
Open

Refreshing browser removes widget data until next data push #176

qthatswho opened this issue Jan 7, 2021 · 7 comments
Labels

Comments

@qthatswho
Copy link

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):

  • OS: macOS Big Sur
  • Browser Safari
  • Version 14.0.2
  • Ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]

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.

@qthatswho qthatswho added the bug label Jan 7, 2021
@kinow
Copy link
Member

kinow commented Jan 7, 2021

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
Copy link
Author

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
Copy link
Member

kinow commented Jan 7, 2021

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

@qthatswho
Copy link
Author

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
Copy link
Member

kinow commented Jan 8, 2021

Trying to reproduce. Installed the gem from master.

  • smashing new testing, cd testing
  • smashing start
  • visited http://localhost:3030
  • used the jobs & dashboards that come with the default template, replacing the valuation in the sample.rb job
    • SCHEDULER.every '10s' do instead of 2s
    • current_valuation = current_valuation + 1 so that every 10 seconds the valuation is increased by 1
  • chose a random number ($3), about one second after it appeared, and then pressed the refresh button
  • the dashboard refreshed, and the valuation (which uses Number widget) displayed $3, then $4

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
Copy link
Author

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
Copy link
Author

qthatswho commented Jan 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants