Skip to content

Core: Only filter events from item/location name to id with id None #5142

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duckboycool
Copy link
Contributor

What is this fixing or adding?

Currently if you have a location/item id of 0, these will get automatically filtered out by the filter meant to remove events. This causes such IDs to not error in unittests since they are removed before running. I don't think there'd be a reason for any other falsy values besides None to be filtered either.

How was this tested?

Running the ID tests on a world that has an item or location with ID 0 to confirm it's now caught.

If this makes graphical changes, please attach screenshots.

0️⃣👎

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jun 27, 2025
Copy link
Collaborator

@BadMagic100 BadMagic100 left a comment

Choose a reason for hiding this comment

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

Time to start a fight over whether the existence of truthiness is a net benefit!

@duckboycool
Copy link
Contributor Author

duckboycool commented Jun 27, 2025

Perhaps another relevant PR is #4661, which moves to explicitly allow things besides None as "events". I think either way it's probably preferable to not let 0 be counted as an event though.

@ThePhar
Copy link
Member

ThePhar commented Jun 27, 2025

World locations or items with an id of 0 are technically against the AP spec anyway (purely to avoid this issue with AP or client-lib implementations), so world developers should not be doing this.

I thought it should also fail tests (for the world).

@Exempt-Medic
Copy link
Member

I'll mention here as well that our current docs are inconsistent on whether or not we should even be filtering out None in the first place. Sometimes saying events should never go into these tables, and sometimes saying it's fine if they do. I'd personally rather see a change where even None errors out.

@qwint
Copy link
Collaborator

qwint commented Jun 28, 2025

I'll mention here as well that our current docs are inconsistent on whether or not we should even be filtering out None in the first place. Sometimes saying events should never go into these tables, and sometimes saying it's fine if they do. I'd personally rather see a change where even None errors out.

i believe there was an attempted refactor to make None not get filtered and get explicitly checked for asserts and such, but it was objectively worse runtime and decided against, i thought it was a Treble PR but I didn't see it from a quick search, so it may have been fully tested in discord

I thought it should also fail tests (for the world).

the entire reason this pr was brought up was because someone was seeing unintended results and passing unittests, but I think the correct course of action is improve the test to find when people attempt to use invalid ids not change the runtime workflow
(maybe something along the lines of saving the provided dict to a different attr when testing to be checked raw)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. 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.

5 participants