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

Closing parser after making no changes sometimes shows the "Are you sure - it looks like you have made changes" dialog #875

Closed
novakda opened this issue May 7, 2021 · 2 comments
Labels

Comments

@novakda
Copy link

novakda commented May 7, 2021

Environment

Hydrus version: 438, from executable
Platform: Windows 10
OS specifics: 20H2 OS Build 19042.928

What happens

When closing the edit parser dialog, after having made no changes, the "Are you sure" dialog appears occasionally. It does not
happen with every parser, but if it happens with a particular parser it does consistently.

I noticed the "If this is a subsidiary parser..." text, but this it happens on "root" parsers that have no subsidiary parsers as well.

Steps to reproduce

  1. Select network > downloader components > manage parsers from the menu. The manage parsers dialog appears.
  2. Double-click any parser. The edit parser dialog appears.
  3. Press ESC to close the edit parser dialog. * The are you sure alert MAY appear.*

Desired outcome

The alert should only appear if changes have been made to the parser, or change the prompt "If this is a subsidiary parser..." if this a normal thing for "root" parsers as well.

Error message / Log file / Screenshots

(n/a)

Notes

I've done a LOT of parser edits over the last few months including things like deleting, exporting everything to a PNG, re-adding some default parsers, etc., so who knows what condition my data is in? 😄 I will try to replicate on a new Hydrus instance.

@novakda novakda added the bug label May 7, 2021
@novakda
Copy link
Author

novakda commented May 10, 2021

Confirmed on a fresh install of v438, with default parsers. Tested by opening each parser in manage parsers in turn then pressing [Esc] to close the window.

All except "gelbooru 0.2.5 file page parser" worked as expected. It does not have a subsidiary parser.

Parser definition via clipboard, for reference:

[58, "gelbooru 0.2.5 file page parser", 2, ["gelbooru 0.2.5 file page parser", "9391aa149c6f53ad97600f5b383d8188c026c8bbe0c65b14df2d7e8c19d8b4a9", [55, 1, [[], "example string"]], [], [26, 1, [[30, 6, ["character tags", 0, [27, 7, [[26, 1, [[62, 2, [0, null, {"class": "tag-list"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, null, {"class": "tag-type-character"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "[^\\?\\-+\\s]", null, null, "bare shoulders"]]]]]]], "character"]], [30, 6, ["creator tags", 0, [27, 7, [[26, 1, [[62, 2, [0, null, {"class": "tag-list"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, null, {"class": "tag-type-artist"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "[^\\?\\-+\\s]", null, null, "bare shoulders"]]]]]]], "creator"]], [30, 6, ["file url - Original Image", 7, [27, 7, [[26, 1, [[62, 2, [0, "li", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 0, "href", [84, 1, [26, 1, [[51, 1, [2, "^.+gelbooru.com\\/+images\\/.+$", null, null, "https://simg3.gelbooru.com//images/9e/4a/9e4a6016ed6fb1aa44e3b274ecc86f07.png"]]]]]]], [7, 75]]], [30, 6, ["file url - meta property", 7, [27, 7, [[26, 1, [[62, 2, [0, "meta", {"property": "og:image"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 0, "content", [84, 1, [26, 1, []]]]], [7, 50]]], [30, 6, ["md5 - meta property", 15, [27, 7, [[26, 1, [[62, 2, [0, "meta", {"property": "og:image"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 0, "content", [84, 1, [26, 1, [[55, 1, [[[9, [".*([0-9a-f]{32}).*", "\\1"]], [5, "hex"]], "https://gelbooru.com/images/9e/4a/9e4a6016ed6fb1aa44e3b274ecc86f07.png"]]]]]]], ["md5", "hex"]]], [30, 6, ["meta tags", 0, [27, 7, [[26, 1, [[62, 2, [0, null, {"class": "tag-list"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, null, {"class": "tag-type-metadata"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "[^\\?\\-+\\s]", null, null, "bare shoulders"]]]]]]], "meta"]], [30, 6, ["rating tags", 0, [27, 7, [[26, 1, [[62, 2, [0, "li", {}, null, null, true, [51, 1, [2, "^Rating: ", null, null, "Rating: safe"]]]]]], 1, "content", [84, 1, [26, 1, [[55, 1, [[[9, ["^Rating: ", ""]]], "Rating: safe"]]]]]]], "rating"]], [30, 6, ["series tags", 0, [27, 7, [[26, 1, [[62, 2, [0, null, {"class": "tag-list"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, null, {"class": "tag-type-copyright"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "[^\\?\\-+\\s]", null, null, "bare shoulders"]]]]]]], "series"]], [30, 6, ["source time", 16, [27, 7, [[26, 1, [[62, 2, [0, "li", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "^Posted: ", null, null, "Posted: 2018-03-28 12:30:33"]], [55, 1, [[[10, ["Posted: %Y-%m-%d %H:%M:%S", 0, 0]]], "Posted: 2018-03-28 12:30:33"]]]]]]], 0]], [30, 6, ["source url - pulling from edit form", 7, [27, 7, [[26, 1, [[62, 2, [0, "input", {"id": "source"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 0, "value", [84, 1, [26, 1, []]]]], [8, 0]]], [30, 6, ["unnamespaced tags", 0, [27, 7, [[26, 1, [[62, 2, [0, null, {"class": "tag-list"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, null, {"class": "tag-type-general"}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]], [62, 2, [0, "a", {}, null, null, false, [51, 1, [3, "", null, null, "example string"]]]]]], 1, "href", [84, 1, [26, 1, [[51, 1, [2, "[^\\?\\-+\\s]", null, null, "bare shoulders"]]]]]]], ""]]]], ["https://gelbooru.com/index.php?page=post&s=view&id=4163910"], {"url": "https://gelbooru.com/index.php?md5=a555240df8005a7bc643153ddaaa9a58&page=post&pid=0&s=list", "post_index": "1"}]]

@hydrusnetwork
Copy link
Owner

Thank you for this report. I am sorry I am getting back to it so late--I am trying to catch up with my bug reports now. I regret the delay.

The problem here is I hacked in the 'has changes' detection automatically, by testing if the parsing object changed in any possible way from the one that booted with the dialog. However parsing objects also hold some test data, and the dialogs now update older parsing objects with nicer test data. Then, when the parent dialog gets a cancel call and looks for changes, it finds some, even though they are superficial and not user-made.

I now nullify the test data before the comparison is made, and it seems not to now give a false positive warning. This will be out for this week's release. Please let me know if you have any more trouble with it.

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

No branches or pull requests

2 participants