The 1Password Community forums are in read-only mode from Jan 28th - Feb 4th, 2025. Find out more.

Login on AJAX form fails only sometimes, because XHR request is being canceled

frankmichel
frankmichel
Community Member

The auto-submit login sometimes fails on AJAX forms, because the XHR is being canceled. I think it happens because end.min.js sends another simultaneous HTTP POST request to the form which cancels the XHR request. I am not sure why this happens. I have deleted and newly saved the login and it still happens. Weird enough only sometimes and I don't know how to reproduce it constantly. Any help is very much appreciated!


1Password Version: 4.4.3
Extension Version: 4.4.0.90
OS Version: OS X 10.9.5
Sync Type: Dropbox

Comments

  • littlebobbytables
    littlebobbytables
    1Password Alumni

    Hi @frankmichel,

    Without knowing the page to take a peek the only thing I can think to suggest is disabling submit for this particular Login item. That will allow you to initiate signing in and hopefully bypass the issue. Certainly it's worth trying anyway.

    1. Edit the Login item from the main 1Password window.
    2. Two new options will become visible in Edit mode, one of which is titled submit. The default setting is Submit when enabled - try changing it to Never submit.
    3. Save the Login.

    This will stop the submit after filling. Does this help with the page? If the issue isn't consistently reproducible as you say it could be a timing issue. Maybe we're trying to do something too fast and the site doesn't like it? If this was the case then this should help (in theory).

    Please do let us know if it makes any difference.

  • frankmichel
    frankmichel
    Community Member

    Hi @littlebobbytables,

    This has really been annoying. So I digged down deeper in the end.min.js. I found this piece of code in row #46 that was most probably causing the issue:

    b=document.createEvent('UIEvent'); b.initEvent('submit',!0,!0,window,1); a.dispatchEvent(b); a.submit();

    To me this looks like the submit event is being dispatched and then one more time executed.

    Commenting out the last a.submit helped solving the issue and the form is still being submit automatically.

    b=document.createEvent('UIEvent'); b.initEvent('submit',!0,!0,window,1); a.dispatchEvent(b); /*a.submit();*/

    Maybe someone at AgileBits can look into this and fix this for the next release. I appreciate your feedback.

  • Megan
    Megan
    1Password Alumni

    Hi @frankmichel,

    Thanks for getting back to us! I am sorry to hear that this has been a frustrating issue for you. Just to confirm - did Little Bobby's suggestion of disabling auto-submit for the site help, or are you resorting to commenting out the code because his solution was ineffective?

  • frankmichel
    frankmichel
    Community Member

    Hi @Megan,

    Disabling auto-submit did help, but I really wanted to use auto-submit. So I dug into the end.min.js script, which was causing the issue.

    Commenting out the a.submit(); made the auto-submit working again without any race condition issues.

  • Megan
    Megan
    1Password Alumni

    Hi @frankmichel ,

    Thanks so much for confirming that! I'll pass those details along to our extension development team. I'm with you - I'm a big fan of auto-submit, but it's good to know that disabling it will work while we investigate a more proper solution.

    ref: OPX-1045

This discussion has been closed.