Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze popup when uploading data about loosing data #231

Open
marianfoo opened this issue May 23, 2023 · 1 comment
Open

Analyze popup when uploading data about loosing data #231

marianfoo opened this issue May 23, 2023 · 1 comment
Assignees

Comments

@marianfoo
Copy link
Member

marianfoo commented May 23, 2023

With #223 it was #214 fixed
Need to analyze why this popup for loosing data activated.
On V2 FE Non Draft 108:
In Object Page, go to edit mode and change a line. Then upload a Excel file.
A popup appears about loosing data.
Apparently also happens on list report when uploading Excel files twice.
Currently the popup is just turned off, but there is maybe and underlying issue or better solution for this.
Maybe this is just the best solution.

@marianfoo marianfoo added the bug Something isn't working label May 23, 2023
@marianfoo marianfoo self-assigned this Oct 2, 2024
@marianfoo marianfoo removed the bug Something isn't working label Oct 2, 2024
@wridgeu
Copy link
Collaborator

wridgeu commented Oct 30, 2024

Heyo, not a solution but maybe the input can help? Maybe not and I'm completely off base here. ^^

I had a look at 1.108 vs 1.96. In 1.96 (all V2 FE non Draft, like in the original issue) when you're doing the following sequence:

  • go into the object page
  • click edit
  • upload something via spreadsheet uploader

It leaves the edit mode but the table isn't refreshed with the newly added entry, oddly enough, I also couldn't see something in the getPendingChanges method of the default (unnamed) model. If you enter edit mode again, randomly press save (though you haven't, technically at this point, done any more change, the model updates!) the table displays the uploaded entry.

In 1.108 or the latest even, doing the same looked alright? Meaning, if I had one demo entry and added 4 more entries using the spreadsheet uploader, there were now 5 entries in total, as expected.

In Object Page, go to edit mode and change a line. Then upload a Excel file.
A popup appears about loosing data.

Not sure if this is just to reproduce the popup but in general this action/behavior in itself makes total sense to me and doesn't classify as a bug. By changing anything within the table before uploading, you're creating a pending change in the model and thus triggering the data-loss popup. Seems about right, doesn't it? You have a change, adding new entries may remove previous changes, thus, prompting the abort of the action itself?

Though you may argue that adding new entries via the spreadsheet uploader doesn't adjust/change the previous changes or entries in total and they will therefore remain in tact making the popup a "bug" in that sense. But is that always the case then? Err'ing on the safe side seems reasonable.

You have probably debugged here already multiple times, still: bHasChanges + bNeedsPopup would be great places for a breakpoint here in the DataLossHandler (coming from CommonUtils):
Image

Apparently also happens on list report when uploading Excel files twice.

This I couldn't reproduce at all. Uploaded a few times the same things like a maniac in 1.120, 1.108 and 1.96 but aside from not properly updating the tables in some version(s) it seemed fine.

The way wouter described it in his initial issue definitely seems like a bug but I couldn't reproduce that. Except: Could that be the "not displayed but yet still created" row in my observation above? Then maybe I looked at the wrong model or pending changes? If so ... I guess some more playing around with the upload and observing application state and trying to actually trigger the popup would be needed.

Disclaimer: me commenting is no sign of urgency on this bug nor do I face the issue myself. I simply had some time on my hands, needed a distraction, and thought maybe I can help, so I had a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants