jow- / luci-ng

LuCI on Angular
84 stars 26 forks source link

(feat) ui-core: save workflow #47

Open ianchi opened 6 years ago

ianchi commented 6 years ago

UCI Pages still lack a complete save workflow. Some months ago we have a rather lengthy IRC chat on the topic with @jow- I open this issue with the conclusions, to keep record and to track development:

<ianchi> Or perhaps it is simpler to cache both apply_sid and apply_user, and grant the commit if either match with the "confirm"
<jow> indeed
<jow> and the strictness or rather "looseness" can be set with the apply request
<jow> like uci/apply { rollback: true, allow_same_user: true }
<ianchi> ok
<ianchi> So, we seem to have found a middleground. I'll try to sum up to recheck:
<ianchi> 1) Do save - apply - confirm
<ianchi> 2) if confirm goes thru -> happy ending
<ianchi> 3) if it takes too much notify the user and urge to test new address, or config, or ..
<ianchi> 4) if still we are on the same page and the deadline is reached, notify that a rollback is being done
<ianchi> 5) do a resync to reload the reverted config
<ianchi> alternatively
<ianchi> 6) the user changed the address
<ianchi> 7) after "all" first load luci-ng send a "confirm", if it is rejected ignore it. If it is accepted, we could inform the user of successfull save. 
<jow> yes
<ianchi> On step 4, we could also offer the option of resaving without rollback protection
<jow> optionally, but we would need to find a way to reach the device first in order to cancel pending rollbacks
<ianchi> but at that point in time the rollback deadline is already reached and so should have been performed. If a final confirm gets thru but gets rejected, we know we are back and rollbacked
<jow> right, okay
<ianchi> All this assumes that we change rpcd-uci to add the "allow_same_user" option

Summary of the main problems being addressed: