Respect instance whitelist when determining blacklist status - #104
Merged
Conversation
- Modified getInstance, getActivities, and getInstances to check is_whitelisted - Whitelisted instances are never marked as blacklisted, even if they have a blacklist entry - Added test for instance 16707634209 to verify whitelist behavior
- Added test in history.test.ts to verify whitelisted instances are not blacklisted - Added test in instances.test.ts to verify whitelisted instances are not blacklisted - Both tests use instance 16707634209 to verify the whitelist behavior
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the blacklist logic to respect instance whitelist status. When an instance has is_whitelisted set to true, it will no longer be marked as blacklisted, even if a blacklist entry exists for it.
Key Changes:
- Updated SQL queries in three service functions to check
is_whitelistedbefore marking instances as blacklisted - The new logic:
(b.instance_id IS NOT NULL AND NOT instance.is_whitelisted) AS "isBlacklisted" - Added a test case for
getInstanceto verify that whitelisted instances returnisBlacklisted: false
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/services/instance/instance.ts | Modified getInstance query to exclude whitelisted instances from blacklist status |
| src/services/player-instances/history.ts | Modified getActivities query to exclude whitelisted instances from blacklist status |
| src/services/player-instances/instances.ts | Modified getInstances query to exclude whitelisted instances from blacklist status |
| src/services/instance/instance.test.ts | Added test case to verify whitelisted instances are not marked as blacklisted |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use COALESCE to treat NULL is_whitelisted as false - Prevents NULL values from causing incorrect blacklist status - Updated getInstance, getActivities, and getInstances queries
Barecheck - Code coverage reportTotal: 94.58%Your code coverage diff: 0.11% ▴ Uncovered files and lines
|
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.
This PR modifies the blacklist logic to respect the instance whitelist flag. When an instance has
is_whitelistedset to true, it will never be marked as blacklisted, even if there's a blacklist entry.Changes
getInstance,getActivities, andgetInstancesto checkis_whitelistedbefore marking an instance as blacklisted(b.instance_id IS NOT NULL AND NOT instance.is_whitelisted) AS "isBlacklisted"Testing