Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/Traits/SegmentDisabledTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function isSegmentDisabled(int $id_job, int $id_segment): bool

// retrieve from cache fails, we need to check the database and update the cache accordingly
if (empty($cachedValue)) {
$metadataList = SegmentMetadataDao::get($id_segment, 'translation_disabled');
$metadataList = SegmentMetadataDao::get($id_segment, 'translation_disabled', 0);
$metadata = $metadataList[0] ?? null;
$isDisabled = (($metadata->meta_value ?? '0') === '1');
Comment on lines 52 to 55
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

isSegmentDisabled()'s cache-miss path behavior changed (DAO cache bypass via ttl=0), but the existing unit tests for this trait only cover the Redis-hit path and skip DB/DAO interactions. Please add coverage for the cache-miss branch (e.g., by extracting the SegmentMetadataDao::get(...) call into an overridable method or injecting a DAO so the test can assert the ttl=0 behavior without a real DB).

Copilot uses AI. Check for mistakes.
$this->_setInCacheMap($cache['key'], $cache['query'], [$isDisabled ? 1 : 0]);
Expand Down
Loading