Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Handle grid view on websocket notifications #211

Closed
teosarca opened this issue Jan 19, 2017 · 7 comments
Closed

Handle grid view on websocket notifications #211

teosarca opened this issue Jan 19, 2017 · 7 comments

Comments

@teosarca
Copy link
Member

We introduced following websocket endpoint: /view/.
e.g. /view/c10edf64-88e7-4ce3-bde5-2ffd901ed0c1

All change notifications related to a given viewId will be sent to that endpoint.

TODOs:

  • when opening a view, connect to it's websocket endpoint too
  • when closing a view, disconnect from that endpoint
  • handle received events

Current view change event has following format:

{
	"viewId": "the view id",
	"windowId": the_window_id,
	"fullyChanged": true|false|missing
}

where:

  • fullyChanged - if set and it's true, the frontend has to fully reload the data

Future:
In future we will introduce more options to be able able to partially stale a data etc

@teosarca teosarca added this to the 2017-05 milestone Jan 19, 2017
@cadavre
Copy link
Contributor

cadavre commented Jan 30, 2017

If fullyChanged=true shall we generate new viewId or just get data for existing one?

Could you please add Swagger documentation for this?

@teosarca
Copy link
Member Author

If fullyChanged=true shall we generate new viewId or just get data for existing one?

just get data for existing one (IMPORTANT)

@cadavre
Copy link
Contributor

cadavre commented Jan 31, 2017

I'm thinking... While we reload data for existing viewId we can keep same page opened and same ordering – it's all fine. But I guess that if user have selection it will be gone (i.e. due to changed elements on page he's looking at). Maybe we should provide notification with info "There are new/updated documents in this view. Click here to reload." and reload on user-click instead of immediately. I'm little bit concerned about making user feel lost on "magic" reloads. As an example take Twitter.

@cadavre
Copy link
Contributor

cadavre commented Jan 31, 2017

ws://{hostname}/view/{viewId} is the endpoint to connect WebSockets to.

@teosarca
Copy link
Member Author

NOTE: as discussed on skype, for now is OK just to automatically reload the data (using the save viewId!).

about user selection, what u can do is:

  • before refreshing, memorize the selected documentIds
  • actual refresh
  • after refreshing: check the documentIds and select as much as possible.

About the notification: yes, that would be another use case. For now, we just need this one.

@cadavre
Copy link
Contributor

cadavre commented Jan 31, 2017

It's not good idea for selection... or... you will ensure that user won't have his current view rows different. Imagine situation when user selects first and last row. Notification comes and view is reloaded with 3 new rows added. Then selection for previously selected last row won't be possible (it is not visible on grid anymore).

@teosarca
Copy link
Member Author

i would suggest to keep what you can.

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

No branches or pull requests

3 participants