Forum Discussion

HenrikHL's avatar
HenrikHL
Frequent Contributor
3 years ago

SwaggerHub to use Optimistic locking

Hi,

I have lately encountered a problem updating Domains. Because SwaggerHub always opens links (the "Jump To.." on $ref) in a new browser window - the number of Tabs with SwaggerHub apis/domains increases. It often happens that multiple tabs contains the same Domain - lets call the Tabs "Tab A" and "Tab B".

I do my updates on the Domain (in "Tab A") and then save - no problem. The problem occurs next time I do an update on the same Domain - if I (I know this is my mistake) choose a different Tab ("Tab B" - containing "old" Domain data) and do my updates and save the Domain - the changes I did in "Tab A" disappear 😞

It would be nice to have some kind of Optimistic locking when saving. In the above scenario "Tab B" should give an error when trying to save - letting you know the Domain has been updated since you loaded the page.

I see two solutions to the above:

  1. Optimistic locking - letting you know that the Domain you are trying to save has been updated in the meantime
  2. Try to reuse Tabs when clicking on $ref links (the "Jump to...") - I don't know if this is possible - also it does not solve the problem if multiple people are working on the same Domain...

 

3 Replies

  • HenrikHL's avatar
    HenrikHL
    Frequent Contributor

    Any comments from the SmartBear team would be appreciated - is this something you would consider?

  • HenrikHL's avatar
    HenrikHL
    Frequent Contributor

    This just happened again πŸ˜‘

    I had the same Domain open in 2 tabs - and one overwrote what I had worked on for 2 hours in the other tab (I did not realize the same Domain was open both places).

    After Smartbear removed the possibility to backup to GitHub on save for Domains - my work is now lost - and I have a release tomorrow...

    I know you have made something to prevent this - but apparently it did not work!