Closed (fixed)
Project:
Autosave Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2019 at 09:38 UTC
Updated:
2 Jan 2021 at 11:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shahankitb commentedComment #3
shahankitb commentedComment #4
shahankitb commentedComment #5
shahankitb commentedComment #6
shahankitb commentedComment #7
shahankitb commentedComment #8
hchonovYour patch simply removes the message, but autosave is already disabled when the message appears. Currently when the browser client is unable to reach the server or some error occurs during the communication, then autosave will be disabled. Could you please check why does it it happen, that your communication is being interrupted?
Comment #9
shahankitb commentedTo resolve this issue would probably require changes to the Javascript to reconnect to the server when a connection is broken.
Comment #10
shahankitb commentedWhen user edit the form and inactive for few minutes. Then it gives error message from
autosave_form/js/autosave_form.js
Comment #11
shahankitb commentedComment #12
hchonovAs you see the message shows how to resolve the problem :).
I think it might be okay to still show the message, but instead of completely disabling autosave continue trying to reach the server. However from now on the notification in the right down corner should warn about an error during autosave.
What do you think? Do you wanna give it a try?
Comment #13
hchonovComment #14
shubhangi1995Hi @hchonov
seems the "pagehide" in line 36 in autosave_form.js is the main reason as its not getting triggered, on page change maybe we can use document hidden ?
Comment #15
shubhangi1995Comment #16
shubhangi1995Comment #17
shubhangi1995Comment #18
hchonov@shubhangi1995, isn't the problem that for some reason the request isn't successful and therefore the message is shown?
Maybe a network issue or something in that way?
What if we instead offer a button on the message to try to re-establish the autosave session?
Comment #19
shubhangi1995@hchonov sure we could, but would not that bring more complexity soecially for content editors as they might feel it redundant and would like to get it automatica.
Comment #20
hchonovShould we then show the message only if there is user interaction and otherwise just keep trying to perform the request?
Comment #21
shubhangi1995i think we should test if user is active or not if he is active only then call should go else there should be no call.
Pros: no unnecessary calls + no unwanted warnings.
Comment #22
hchonovThis would be very good, yes. Actually I've even been thinking at some point to send the requests only if there was change since the last request. I guess that would also be easier to implement as it might just need one onchange event listener on the form input elements and then flag the form as needing autosaving when the next autosave interval occurs.
Something like this eventually:
Comment #25
hchonovI've added a new experimental option which will limit the autosave submissions to only when the form has changed. The detection mechanism is based on a modified version of https://www.drupal.org/project/entity_form_monitor, which is why I am crediting the maintainer of that project - Dave Reid.
Comment #26
hchonovWith this I consider this issue as resolved. Feel free to re-open if it does not work as expected after you've enabled the new option in the Autosave Settings.
Comment #28
shubhangi1995hchonov thanks for the changes :)