Open realVinayak opened 1 year ago
The url in the screenshot: https://osuorton3823-edge.test.specifysystems.org/
Happens in Chrome, Edge and Firefox
You have an unsaved form behind the dialog. Opening the dialog is fine and doesn't trigger the unload protect dialog. Actually clicking on a record set would replace the form with a record set, thus unload protect dialog is triggered to warn you about this. Not a bug. Though, if you think this is a UX issue, do you have suggestions on improving this?
Not showing the save dialog if there actually weren't changes! I discovered this while on production database and thought I changed the form
On Tue, Mar 28, 2023, 20:26 Max Patiiuk @.***> wrote:
Closed #3259 https://github.com/specify/specify7/issues/3259 as not planned.
— Reply to this email directly, view it on GitHub https://github.com/specify/specify7/issues/3259#event-8871037272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSKLYXO3CKSZJUBRL5JBP3W6OFVVANCNFSM6AAAAAAWKRRVMU . You are receiving this because you authored the thread.Message ID: @.***>
Not showing the save dialog if there actually weren't changes
Ah, that's a separate issue, not connected to record sets.
Two bugs here:
TODO:
From @bronwyncombs:
Describe the bug Using the
Browse in Forms
button in query dialog through stats page requires save before moving pages.To Reproduce Steps to reproduce the behavior:
- Go to statistics page
- Click on a statistic with query attached
- Click on
Browse in Forms
- Use paginators
- See error
Expected behavior Should allow to click through forms since no edits are made.
Screenshots Desktop:
- OS: macOS
- Browser: Chrome
- Specify 7 Version: 7.9-dev
Database Name: If applicable herb_rbge_3_31_23
Reported By Name of your institution
Additional context Database name or any other context about the problem here.
https://github.com/specify/specify7/assets/135047322/9b8b0b13-4cc0-4002-8eda-6eb97e8dfbb2
Browse in Forms
doesn't have this issue in the main query builder, only through the stats query dialog. Do you still want these merged?
@maxpatiiuk @melton-jason , we met with @bronwyncombs for this issue because I couldn't reproduce. We discovered that it happens only if different tabs in the browser of the stat page are opened. If we have only one time Sp7 opened there is no issue. What are your thoughts?
set a breakpoint on this line:
and when it hits, go up the stack to see who triggered the field change and why
there could be several different causes for this issue - would be best to fix them all
I cannot reproduce neither on my localhost or on the test panel. I know I saw it happening on Bronwyn's computer..
Browse in Forms
doesn't have this issue in the main query builder, only through the stats query dialog. Do you still want these merged?
It looks like this is not the case for me:
https://herbrbge31323-v79-dev.test.specifysystems.org/specify/query/271/
https://github.com/specify/specify7/assets/37256050/57cb3c1d-58be-4e3c-a1c2-5cf7d62525be
This is likely an unrelated issue that @maxpatiiuk mentioned:
TODO:
- Check if the two bugs mentioned in the previous commend (https://github.com/specify/specify7/issues/3259#issuecomment-1487878114) are still reproducible on xml-editor
- Fix them
This has been a problem for a long time (at least since Specify 7.7+) where something is set upon the form loading that makes Specify think some edit has been made when it really has not.
Still works for me from query builder:
https://github.com/specify/specify7/assets/135047322/22b2dc22-848c-47eb-8421-753733493786
Only some have this issue from stats:
https://github.com/specify/specify7/assets/135047322/8487ce79-c032-4d8e-99c1-232e89673483
This is a new instance on a different database with one tab open at a time
Can we reproduce it on xml?
@bronwyncombs @CarolineDenis
Still works for me from query builder:
Screen.Recording.2023-07-10.at.11.47.54.AM.mov
Only some have this issue from stats:
screen-recording-2023-07-10-at-113003-am_LLKnihLE.mp4
This is a new instance on a different database with one tab open at a time
The issue is that you are testing different queries and different forms. These need to be the same to confirm whether behavior is consistent between them.
On the Preparation form, nothing is being set upon load, which doesn't prompt Specify to ask if you want to save.
On the Determination form, the date precision (presumably) is being set upon load, which prompts Specify to ask you if you want to save before you can navigate away.
This is the actual underlying issue^^^ I'd guess that the issues you're seeing with queries in stats will behave similarly in the query builder, and vice versa.
Could re-create when: stats > Paratype > browse in forms @maxpatiiuk where do we set resource.needSaved to true?
If this is not introduced in v7.9
, we should move this to v7.9.1
.
Note, that this bug could be specific to a single record and a specific form. Note, that this bug could have many causes, but all result in a same symptom. Note, saving the record may cause the bug to disappear for this record (i.e let's say lat long type had an invalid value - sp7 front-end fixes it, which trigers a unload blocker - but if you save the record, next time you open it it is correct, so this "bug" does not happen again. Invalid lat long being fixed is a valid behavior, but there could be invalid behavior too - infinite loops where data is converted from one format to another and back).
@CarolineDenis this line I sent is the only place where we set resource.needSaved=true
:
But, this function in turn is called in several places (in 3 places I belive, one of which is .set()
)
To debug this issue:
this.specifyModel.name
(or this.specifyTable.name
if on xml-editor
) matches the table name you expect (i.e CollectionObject
rather than PickList
or TreeDefItem
- you might see the later as those are created and edited by front-end behind the scenes, especially on initial page load).set()
function and why and with what value and what was the previous value. See https://developer.chrome.com/docs/devtools/javascript/reference/#call-stack"3.When breakpoint hits, double check that this.specifyModel.name (or this.specifyTable.name if on xml-editor) matches the table name you expect (i.e CollectionObject rather than PickList or TreeDefItem - you might see the later as those are created and edited by front-end behind the scenes, especially on initial page load)" The name is correct
@melton-jason can this be closed?
I am unsure whether this should be closed or not, as the underlying cause of the issue is very far-reaching and pops up often.
However, this issue has become synonymous with the problem that has been fixed as of #3774, which is why I closed it. Each instance of this problem can be diagnosed via adding a breakpoint to https://github.com/specify/specify7/blob/39cb18c84e94bd783fc10757b593039e683df8b8/specifyweb/frontend/js_src/lib/components/DataModel/resourceApi.js#L121 However, exactly what caused that line to be run will probably vary for each iteration of the issue, and that may warrant opening separate issues.
This problem as a whole however can probably not be considered entirely 'fixed' until we rewrite the ORM and get away from Backbone.
Encountered this today on sdnhmpaleo_3_31_23
while using Browse in Forms for Locality records.
https://github.com/specify/specify7/assets/135047322/c9702a48-cc77-4196-b023-6811b25f6dfd
Solved by #3959
https://github.com/specify/specify7/assets/37256050/f41816ba-e76b-4810-972b-67c2a1a9b3a8
Going through Determination records causes this issue for me in agent merging
Reopened. Still present in Locality Record Sets. Happens in both https://github.com/specify/specify7/pull/3959 and https://github.com/specify/specify7/pull/3774
This also happens when navigating through a record set created using the WorkBench.
https://github.com/specify/specify7/assets/164079735/2d799c46-2647-49f2-a054-d1e8477d2242
Can recreate in edge (7.9.6) but only with one RS. There are probably other RS in other dbs that can also recreate this issue but this is what I found. Not sure why this one is different though, maybe just because it's an old WB upload?
https://github.com/user-attachments/assets/4fc9227b-ab3f-4149-987e-2ec4512c4c7b
From @bronwyncombs
Describe the bug A clear and concise description of what the bug is.
the 8th record in this record set specifically triggers unload protect: demofish record set
Happens on this record set in
fwri
when you skip to the last record and go backward: fwri record set
- OS: macOS
- Browser: Chrome
- Specify 7 Version:
v7.9
- Database Name:
fwri_1_9_24
andsp7demofish_2_9_24
Additional context
related issue: https://github.com/specify/specify7/issues/3259
Describe the bug If you click on 'Record Sets', then I am shown the list of record sets for that user. Try going from one record set to another and I get the dialog message 'This form has not been saved' even if I didn't change anything. A major issue because I wanted to know if I accidentally changed anything or not. This is in production by the way.
To Reproduce Steps to reproduce the behavior:
Expected behavior Shouldn't trigger the form change. Or at least tell me what changed.