Skip to content

Fix user response cache type error - #166

Open
jeffbyrnes wants to merge 1 commit into
gharlan:mainfrom
jeffbyrnes:fix-user-response-cache-typeerror
Open

jeffbyrnes wants to merge 1 commit into
gharlan:mainfrom
jeffbyrnes:fix-user-response-cache-typeerror

Conversation

@jeffbyrnes

Copy link
Copy Markdown

Summary

This fixes the Cannot assign array to property Search::$user of type stdClass fatal seen when invoking the workflow with a cached /user response that is no longer an object.

Compared to #164, this keeps the local variable safety improvement but also:

  • verifies the fetched /user response is actually a stdClass before assigning it to Search::$user
  • clears a bad cached /user row so the workflow can recover instead of repeatedly failing
  • hardens Fetcher so object responses are not merged with paginated child cache rows
  • removes stale child cache rows when an object response is refreshed
  • adds regression coverage for corrupt child-cache rows attached to object endpoints

This is intended to supersede #164.

Testing

  • php -l src/fetcher.php
  • php -l src/search.php
  • php -l tests/FetcherTest.php

I could not run the PHPUnit suite locally because composer / vendor are not installed in this checkout.

AI assistance disclosure

These changes were generated by an AI coding assistant at the request of @jeffbyrnes.

  • Assistant: OpenAI ChatGPT, operating in the Pi coding-agent harness
  • Provider: openai-codex
  • Model: gpt-5.5

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.

1 participant