Skip to content

Respect instance whitelist when determining blacklist status - #104

Merged
owens1127 merged 4 commits into
mainfrom
whitelist-instance-blacklist
Jan 17, 2026
Merged

Respect instance whitelist when determining blacklist status#104
owens1127 merged 4 commits into
mainfrom
whitelist-instance-blacklist

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

This PR modifies the blacklist logic to respect the instance whitelist flag. When an instance has is_whitelisted set to true, it will never be marked as blacklisted, even if there's a blacklist entry.

Changes

  • Modified getInstance, getActivities, and getInstances to check is_whitelisted before marking an instance as blacklisted
  • Whitelisted instances are now excluded from blacklist status: (b.instance_id IS NOT NULL AND NOT instance.is_whitelisted) AS "isBlacklisted"
  • Added test for instance 16707634209 to verify whitelist behavior

Testing

  • Added test case using pgcr 16707634209 to verify that whitelisted instances are not marked as blacklisted

- 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
Copilot AI review requested due to automatic review settings January 2, 2026 21:41
- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_whitelisted before 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 getInstance to verify that whitelisted instances return isBlacklisted: 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.

Comment thread src/services/instance/instance.ts Outdated
Comment thread src/services/player-instances/history.ts Outdated
Comment thread src/services/player-instances/instances.ts Outdated
Comment thread src/services/player-instances/history.ts Outdated
Comment thread src/services/player-instances/instances.ts Outdated
owens1127 and others added 2 commits January 2, 2026 16:45
- Use COALESCE to treat NULL is_whitelisted as false
- Prevents NULL values from causing incorrect blacklist status
- Updated getInstance, getActivities, and getInstances queries
@barecheck

barecheck Bot commented Jan 17, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 94.58%

Your code coverage diff: 0.11% ▴

Uncovered files and lines
FileLines
src/services/instance/instance.ts168
src/services/player-instances/instances.ts50

@owens1127
owens1127 merged commit a1a3004 into main Jan 17, 2026
5 checks passed
@owens1127
owens1127 deleted the whitelist-instance-blacklist branch January 17, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants