-
Notifications
You must be signed in to change notification settings - Fork 0
Clarify join requirement #69
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA clarifying comment was added above a left join statement in the Changes
Suggested reviewers
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -37,6 +37,7 @@ public function getPersistentIds( array $pageIds ): array { | |||
$result = $this->database->newSelectQueryBuilder() | |||
->select( [ 'p.page_id', 'ppi.persistent_id' ] ) | |||
->from( 'page', 'p' ) | |||
// Join is necessary to exclude pages deleted from the `page` table, but not `persistent_page_ids`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the better behavior? And if it is, what about the newly added method? Should we re-add the join there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one use case I can think of where returning deleted IDs might be useful: if you only know the persistent ID and you want to undelete the page. Not sure if there's anything else somebody might want to do with a deleted page ID.
The join is not strictly necessary in the new code, because it does an implicit page existence check (via Title::newFromID()
) before redirecting.
However, if we decide that the "get deleted ID to undelete" use case is necessary, then the new special page should probably also redirect to the deleted page.
Follow-up to #64 (comment)
The join is necessary to avoid returning persistent IDs for deleted pages (e.g. via REST API).
For reference, the corresponding test:
PersistentPageIdentifiers/tests/Adapters/DatabasePersistentPageIdentifiersRepoTest.php
Lines 65 to 75 in 0053bb0
Summary by CodeRabbit