Repository navigation
Fix missing array_values() after array_diff() in VCS PR cleanup - #11742
zaidxshaikh wants to merge 1 commit into
Conversation
array_diff() preserves original keys after removing elements, producing non-sequential numeric keys. Without array_values(), PHP JSON-encodes the result as an object instead of an array, causing malformed data storage in providerPullRequestIds.
Greptile SummaryThis PR fixes a subtle but real data-integrity bug in the VCS GitHub events handler where
Confidence Score: 5/5Safe to merge — single-line bug fix with no side effects and consistent with existing codebase patterns. The change is a minimal, well-understood PHP correctness fix with no ambiguity. It resolves a confirmed data-integrity issue (malformed JSON stored in the database), follows the established \array_values(\array_diff(...)) convention used elsewhere in the repo, and introduces no new logic or risk. No P0 or P1 issues remain. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Fix missing array_values() after array_d..." | Re-trigger Greptile |
|
Closing as this has already been addressed by #13530. Thanks! |
Description
Fixes #11741
When a pull request is closed and external contribution cleanup runs in the VCS GitHub events handler,
array_diff()is used to remove the PR ID fromproviderPullRequestIdswithout wrapping inarray_values().Problem
array_diff()preserves the original numeric keys after removing elements:When stored in the database (JSON-encoded), PHP produces a JSON object
{"0":"101","2":"103"}instead of a JSON array["101","103"], causing malformed data storage.Fix
Wrap
array_diff()witharray_values()to reindex the array, consistent with the pattern used elsewhere in the codebase:Databases/Workers/Databases.php:368—\array_values(\array_diff(...))Account/Http/Account/MFA/Challenges/Update.php:150—\array_values(\array_diff(...))