Skip to content
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

fix deleted objects are not handled at all #67

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

rliebi
Copy link
Contributor

@rliebi rliebi commented Mar 15, 2024

Right now deleted objects are not removed from index. This fix allows to process deleted objects as well and remove them from index.

@rliebi rliebi requested a review from limenet March 15, 2024 09:32
@rliebi rliebi self-assigned this Mar 15, 2024
@rliebi rliebi added the bug Something isn't working label Mar 21, 2024
@limenet
Copy link
Member

limenet commented Mar 21, 2024

Disregard, I forgot getById() returns null instead of throwing

Not entirely certain but I think \Valantic\ElasticaBridgeBundle\Messenger\Handler\AbstractRefreshHandler::resolveElement also needs a fix in the try-catch as the handler might be executed (much) later and getById will fail and the part in lines 28 ff which is supposed to handle that, is skipped because of the exception that's thrown above it.

try {
    $element = $className::getById($message->id);
} catch (\Throwable) {
    throw new PimcoreElementNotFoundException($message->id, $message->className);
}

if (!$element instanceof AbstractElement) {
    // The element in question was deleted so we need a skeleton.
    // ...
}

@limenet limenet merged commit 9a5eee3 into main Mar 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants