Skip to content

🐞 Bug Report: old cache values for get_did_document() cause fatal error #503

Description

@kasparsd

Detailed Description

When checking for updates to FAIR-enabled plugins with DID ID, the following error occurs:

Fatal error: Uncaught TypeError: FAIR\Packages\get_fair_signing_keys(): Argument #1 ($did_doc) must be of type array, __PHP_Incomplete_Class given, called in /public_html/wp-content/plugins/fair-plugin/inc/packages/namespace.php on line 368 and defined in /public_html/wp-content/plugins/fair-plugin/inc/packages/namespace.php:60 Stack trace: #0 /public_html/wp-content/plugins/fair-plugin/inc/packages/namespace.php(368): FAIR\Packages\get_fair_signing_keys() #1 /public_html/wp-content/plugins/fair-plugin/inc/packages/namespace.php(939): FAIR\Packages\get_latest_release_from_did() #2 /public_html/wp-content/plugins/fair-plugin/inc/updater/class-updater.php(93): FAIR\Packages\add_package_to_release_cache() #3 /public_html/wp-content/plugins/fair-plugin/inc/updater/namespace.php(94): FAIR\Updater\Updater::load_hooks() #4 /public_html/wp-includes/class-wp-hook.php(341): FAIR\Updater\run() #5 /public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() #6 /public_html/wp-includes/plugin.php(522): WP_Hook->do_action() #7 /public_html/wp-settings.php(774): do_action() #8 /public_html/wp-config.php(107): require_once('/home/u83550p78...') #9 /public_html/wp-load.php(50): require_once('/home/u83550p78...') #10 /public_html/wp-admin/admin.php(35): require_once('/home/u83550p78...') #11 /public_html/wp-admin/plugins.php(10): require_once('/home/u83550p78...') #12 {main} thrown in /public_html/wp-content/plugins/fair-plugin/inc/packages/namespace.php on line 60

This happens because in #465 the cache value type was updated from storing a serialized instance of DIDDocument to an array.

Expected Behavior

Current Behavior

Steps to Reproduce

Context (Environment)

  • FAIR plugin v1.4

Possible Solution

Add a conditional that doesn't return cache of incorrect type.

Possible Implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions