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

[BUG] EDMC does not automatically add finished scan to notyetsolddata.json #53

Closed
Balvald opened this issue May 18, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working development Issues to do, to improve the development experience
Milestone

Comments

@Balvald
Copy link
Owner

Balvald commented May 18, 2023

Describe the bug
When scanning the second plant on the same planet EDMC works as intended with the exception to not adding the entry to the notyetsolddata.json.
This then shows in the "Scans in this system" section of the plugin where the recently finished scan does not show up.
(not sure if same planet is relevant, Not sure if a third scan would work again)

Specifically the code that it should run but does not for some reason is:

            if currententrytowrite not in plugin.notyetsolddata[cmdr]:
                # If there is no second Sample scantype event
                # we have to save the data here.
                plugin.notyetsolddata[cmdr].append(currententrytowrite)
                file = plugin.AST_DIR + "\\notsoldbiodata.json"
                with open(file, "r+", encoding="utf8") as f:
                    notsolddata = json.load(f)
                    if cmdr not in notsolddata.keys():
                        notsolddata[cmdr] = []
                    notsolddata[cmdr].append(currententrytowrite)
                    f.seek(0)
                    json.dump(notsolddata, f, indent=4)
                    f.truncate()
                currententrytowrite = {}

located at line 83 within bioscan_event() in eventhandling.py

To Reproduce
Steps to reproduce the behavior:

  1. Start EDMC with plugin
  2. Do the first full scan of any Exobiology on a planet.
  3. Do a second full scan of any Exobiology on that same planet.
  4. See error

Expected behavior
the plugin should add the entry of the exobiology scan immediately to the notyetsolddata.json and diplay the finished but unsold scan below the "Scans in this system" line.

Screenshots
Image
Compare what the line "Last Exobiology Scan" says with both the current system and body and see that an entry is missing below the "Scans in this system" line.

Desktop (please complete the following information):

  • OS: Windows 11
  • AST Version: dev 0.2.7
  • EDMC Version: 5.8.1+d81c93c

Additional Context
I can remedy this locally by using the journal crawling function in the settings though it is not great to wait up to a minute after every second scan

@Balvald Balvald added bug Something isn't working development Issues to do, to improve the development experience labels May 18, 2023
@Balvald Balvald added this to the v0.2.7 milestone May 18, 2023
@Balvald Balvald self-assigned this May 18, 2023
Balvald added a commit that referenced this issue May 19, 2023
Also ensuring we ask Canonn upon the first event we know the system that we're in. (otherwise we just don't know how how many plants are in on a planet in that system)

Closes #53
@Balvald Balvald closed this as completed May 19, 2023
@Balvald
Copy link
Owner Author

Balvald commented May 19, 2023

Problem was I did not shallow copy the object into the set that I was testing against so it always was the same in the set of unsolddata and the most current entry.

Balvald added a commit that referenced this issue May 21, 2023
Also ensuring we ask Canonn upon the first event we know the system that we're in. (otherwise we just don't know how how many plants are in on a planet in that system)

Closes #53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working development Issues to do, to improve the development experience
Projects
None yet
Development

No branches or pull requests

1 participant