Skip to content

Incorrect calculation of notification id leads to duplicate entries #13

@gn36

Description

@gn36

This error causes https://www.phpbb.com/customise/db/extension/versionchecknotifier/support/topic/167836?p=519861#p519861

The static function get_notification_id calculates the id incorrectly.

  1. It uses ext_name instead of name
  2. The version information provided by the cronjob is actually an array. The version information stored, however, is only a string. Depending on what is provided, the information differs and therefore the id is calculated differently (including a suppresed error notice of array to string conversion).

Multiple possible solutions:

  1. Calculate ID using internal static function to find the correct new version (slow, seems to cause issues with unittests, yields same ID every call)
  2. simply use a serialized version of the complete array for ID calculation (simple, but has the same problem of different ids)
  3. Move version extraction to cronjob / helper class (should simplify id calculation in notification, yields the same id on every call)

If the same ID is given on every call this is correct behavior. But it changes the behavior of this extension since right now, administrators are reminded frequently about the same outdated extension. So this should be corrected, but maybe it would be best to remark the notification as unread or delete and reapply it. Maybe this can also be used as a basis for a user defined setting on how frequently he wishes to be notified.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions