Repository navigation
Conversation
Status::lastUpdated() only looked at enabled components. Linking a component to an incident is stored on incident_components and does not touch the component, so the status bar kept showing the last time a component was edited ("Last updated 1 year ago") after incidents had been opened, updated and resolved. Take the most recent of enabled components, public incidents and the updates of public incidents.
Larastan with prefer-lowest dependencies types the whereHasMorph closure builder as Builder<Model>, so viewableBy() was reported as undefined. Filter on updateable_type and a subquery of public incident ids instead, as SlackRssController already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Status::lastUpdated()only takes the latestupdated_atof enabled components. Linking a component to an incident is stored onincident_componentsand does not touch the component (the effective status is resolved at read time), so the timestamp only moves when a component itself is editedviewableBy(false), so hidden, authenticated-only and unpublished incidents are left out)Validation
mainand pass with the fixvendor/bin/pest: 1154 passed (4295 assertions)vendor/bin/pint --test: passedvendor/bin/phpstan analyse src/Status.php: no errors