Skip to content

fix: suppress fatal errors in Algolia_Index::get_indexable_records_from_post#43

Merged
justlevine merged 16 commits intomainfrom
fix/suppress-fatals-get_indexable_records_from_post
Nov 9, 2025
Merged

fix: suppress fatal errors in Algolia_Index::get_indexable_records_from_post#43
justlevine merged 16 commits intomainfrom
fix/suppress-fatals-get_indexable_records_from_post

Conversation

@justlevine
Copy link
Copy Markdown
Collaborator

Description

This PR wraps the Post parsing and chunking in Algolia_Index::get_indexable_records_from_post() inside a try-catch block, to silently prevent any fatal errors that would otherwise stop indexing entirely.

Important

This PR is based on #38 which should be merged first.

Technical Details

Checklist

Screenshots

To-do

Fixes/Covers issue

Fixes #22

justlevine and others added 15 commits November 2, 2025 00:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@justlevine justlevine requested a review from Copilot November 5, 2025 20:37
@justlevine justlevine self-assigned this Nov 5, 2025
@justlevine justlevine changed the title fix: surpress fatal errors in Algolia_Index::get_indexable_records_from_post fix: suppress fatal errors in Algolia_Index::get_indexable_records_from_post Nov 5, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 enhances error handling and documentation in the Algolia indexing process. The main changes wrap the record creation logic in a try-catch block to prevent a single failing post from breaking the entire indexing batch, and improves PHPDoc type hints for better code clarity.

Key changes:

  • Added try-catch error handling around post-to-record conversion logic to gracefully skip problematic posts
  • Updated PHPDoc type hints to use standardized array<string,mixed> notation for better IDE support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inc/classes/algolia/class-algolia-index.php
Comment thread inc/classes/algolia/class-algolia-index.php
up1512001
up1512001 previously approved these changes Nov 7, 2025
Base automatically changed from feat/single-index to main November 7, 2025 13:16
@justlevine justlevine dismissed up1512001’s stale review November 7, 2025 13:16

The base branch was changed.

@justlevine justlevine merged commit 887ccbd into main Nov 9, 2025
7 of 9 checks passed
@justlevine justlevine deleted the fix/suppress-fatals-get_indexable_records_from_post branch November 9, 2025 18:18
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.

Indexer crashes when rendering blocks that depend on missing plugins (e.g. GFAPI / Gravity Forms)

3 participants