5.8.4: batched sync, namespace forward-alias, and community fixes - #71
Open
michtio wants to merge 10 commits into
Open
5.8.4: batched sync, namespace forward-alias, and community fixes#71michtio wants to merge 10 commits into
michtio wants to merge 10 commits into
Conversation
Register a Composer files-autoload fallback that aliases craftpulse\typesense\* class names to their existing percipiolondon\typesense\* counterparts, so integrators can migrate their imports and config/typesense.php references to the future namespace today and keep working on 5.8.x. No deprecation is logged on this line: the craftpulse names are the forward target, and the percipiolondon names remain fully supported until 5.9.0. Documents the two-way alias guarantee in the README.
The after-restore / after-move handler queried the element per site and passed the result straight to handleSave(), whose signature is non-nullable, so a query that found nothing (for example when applying a draft) threw a TypeError. Guard the call with an entry check, matching the existing guard on the sibling query path. Reported by @mikeymeister.
Wrap the element event registration (and the delete event) so they only bind when an API key is configured, avoiding a save-time error on a fresh install before the plugin is set up. Adapted from the original PR to fit the current codebase: the API-key guard now wraps the cockpit-aware element filtering (Entry plus the cockpit element types) that postdates the PR, and keeps the null-entry guard on the restore/move re-query, rather than the PR's plain instanceof Entry check which would have regressed cockpit element support. Authored-by preserved from PR #63.
(cherry picked from commit 7cb90d0)
(cherry picked from commit 41c67bd)
Following @jamie-s-white's own note that the new command is destructive, the update-schema action now documents that it drops and recreates every configured collection's fields (shown in ./craft help) and prompts for confirmation unless --force is passed, so the data loss is deliberate rather than a surprise. Also drop the dead CP URL rule the PR added (typesense/update-schema pointed at a collections/update-schema web action that does not exist); the feature is a console command.
Document the 5.8.4 round: the forward-compatibility namespace alias and the 5.9.0 namespace-move heads-up, the batched document sync rework (#70, resolves null entry (#67), .all-collection deletes (#64), events before configuration (#63), and the control-panel action URL / CRAFT_BASE_CP_URL confirmation (#68). Credits @timkelty, @jamie-s-white, @mikeymeister, and @vardumper.
michtio
force-pushed
the
fix/5.8.4-backports
branch
from
July 16, 2026 15:24
8d7cce8 to
39a088f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport round for 5.8.4 on the 5.8.x (
v5) line. Reviewed and cherry-picked with original authorship where the change came from a contributor PR; adapted or fixed on top where noted.Namespace
craftpulse\typesensenamespace. A Composerfiles-autoload shim aliasescraftpulse\typesense\*to the currentpercipiolondon\typesense\*, so integrators can migrate their imports andconfig/typesense.phpreferences now and stay working on 5.8.x. No deprecation is logged on this line (the craftpulse names are the forward target). README + CHANGELOG document the two-way alias guarantee.Queue
BaseBatchedJob. Reviewed against the author's four stated failure modes and confirmed each holds: flush/create side effects run once inbefore()(not per reloaded batch), processed IDs live in a public property that survives queue serialization across spawned jobs,loadData()returns an emptyBatchableon missing client/collection, and the query is cloned and stably ordered by id. Expected to resolve Phantom Pending Task Appearing On Craft Cloud #69.Fixes
instanceof Entrycheck which would have regressed cockpit element support..allcollections (Add the ability to delete documents if the .all syntax is used #64, @jamie-s-white). The delete handler now falls back to thesection.allcollection, matching the save path, so documents in an.all-defined collection are removed.update-schemaconsole command (Update schema console command #61, @jamie-s-white). Drops and recreates each configured collection's fields from config. Follow-up commit makes the destructive behavior explicit (help text + a confirmation prompt,--forceto skip) per the author's own suggestion, and removes a dead CP URL rule the PR added (it pointed at a non-existent web action; the feature is console-only).handleSave()and throw. Guarded, matching the sibling delete path.CRAFT_BASE_CP_URL(Admin Panel Sync/Flash Buttons not respecting CRAFT_BASE_CP_URL - using frontend SITE_URL instead #68, reported by @vardumper). Confirmed the Sync/Flush actions build URLs withcpUrl(), so they respectCRAFT_BASE_CP_URLand post to the control-panel domain (resolving the reported CORS failure when the CP is on a separate domain). Already correct on this line; verified and credited.Not included
is_array($index->section)label logic assumes an arraysectionconfig (a fork convention); stock v5 uses a string section, so the label would never show. It also conflicts with Batch document sync jobs #70 onSyncDocumentsJob, and its only stock-applicable morsel (an "Unkown" -> "Unknown" typo) is already superseded by the Batch document sync jobs #70 rework.Verification
The 5.8.x line has no Pest suite. Verified:
composer installin the branch,php -lon every changed file, and a line-by-line review of each cherry-pick against this codebase's actual call sites and conventions (oldpercipiolondonnamespace, old code style). The batched-sync serialization behavior was verified against Craft'sBaseBatchedJob/__sleepsource; the forward alias was verified resolving at runtime.No release tag is included.