graceguo-supercat edited a comment on pull request #10834:
URL: 
https://github.com/apache/incubator-superset/pull/10834#issuecomment-712514309


   Hi @eschutho Thanks for the work! 
   
   Yes #11220 and #11305 caused conflicts for this PR, and we can make this PR 
work with it. The idea of preventing co-edit is, when dashboard is loaded, it 
carries the last_modified_time which was stored in the database. When user edit 
dashboard and submit new updates to save, we send this last_modified_time with 
all the updates. `/save_dash/` endpoint compares the last_modified_time from 
incoming request with current database: if incoming last_modified_time < 
current data, this means the dashboard was changed **_since_** user open 
dashboard, so the save request will be rejected.
   
   So for the Dashboard Properties modal, right now the problem is it didn't 
send last_modified_time information when it calling `/save_dash/` request, 
which happens after the first save is done. Dashboard Properties modal didn't 
use redux store, but you can manually add this parameter like this:
   
https://github.com/apache/incubator-superset/blob/8863c939ad01fe1e065ce60edc93a683e6828d80/superset-frontend/src/dashboard/reducers/dashboardState.js#L110
   
   this can make sure the incoming request always newer than database record.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to