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

Factorio: Fix 500 error on Factorio multi-tracker. #3184

Merged
merged 2 commits into from
Apr 20, 2024

Conversation

ThePhar
Copy link
Member

@ThePhar ThePhar commented Apr 20, 2024

What is this fixing or adding?

Makes a dict into a Counter collection to prevent a "attr not found" error.

Also fixes a type hint that was wrong.

How was this tested?

Ran webhost and checked tracker.

If this makes graphical changes, please attach screenshots.

N/A

@github-actions github-actions bot added affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Apr 20, 2024
@ThePhar ThePhar added the is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. label Apr 20, 2024
@LegendaryLinux LegendaryLinux merged commit a45fa84 into ArchipelagoMW:main Apr 20, 2024
16 checks passed
@@ -422,11 +422,11 @@ def render_generic_multiworld_tracker(tracker_data: TrackerData, enabled_tracker

if "Factorio" in network_data_package["games"]:
def render_Factorio_multiworld_tracker(tracker_data: TrackerData, enabled_trackers: List[str]):
inventories: Dict[TeamPlayer, Dict[int, int]] = {
(team, player): {
inventories: Dict[TeamPlayer, collections.Counter[str]] = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This collections.Counter[str] type annotation won't work in Python 3.8.

Suggested change
inventories: Dict[TeamPlayer, collections.Counter[str]] = {
inventories: Dict[TeamPlayer, Counter[str]] = {

Another workaround to fix it without typing.Counter is just to put the whole type annotation in quotes.

qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
* Factorio: Fix 500 error on Factorio multi-tracker.

* Hopefully this also fixes the webhost test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: webhost Issues/PRs that touch webhost and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants