Problem

  • The settings page says "API keys have been verified and are correct" even when the client was not able to connect to Mollom.

Cause

  • The NETWORK_ERROR case is not handled separately by _mollom_status().
  • In case API keys were verified as correct before, the configuration status is not updated (to account for potential downtime) — this can mean that API keys were successfully verified on a local developer machine, but can't be verified on a production site (due to a firewall), which in turn causes the inappropriate positive status message to stick.

Proposed solution

  1. Change _mollom_status() to use a cache with expiration date (instead of a variable) — re-verify once per day when API keys are valid, and once per hour in case of any kind of API key verification error.
  2. Remove the fallback to the last known good configuration status (i.e., the downtime protection).
  3. Ensure that the NETWORK_ERROR status code is retained.

Notes

  • Some developers are force-disabling all caches during development, which will cause an API key verification call on every page request. This cannot be prevented.
  • The current variable-based status is prone to a much more problematic misconfiguration: Some developers are using the Features/Variables module to control all variables in code. In that case, the configuration status variable might not be updated at all.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

FileSize
1.74 KB

Follow-up to fix cache item IDs and a too ambiguous cache_clear_all(), which unintentionally invalidated way too many caches.

Status: Needs review » Needs work

The last submitted patch, mollom.status-cache.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
2.56 KB
sun’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
FileSize
8.02 KB

Combined backport to D6.

sun’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.

  • Commit 61d82f3 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #2058645 by sun: Fixed Client-side networking failure is never...
  • Commit c616970 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #2058645 by sun: Fixed cache IDs and ambiguous cache_clear_all()...

  • Commit 61d82f3 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #2058645 by sun: Fixed Client-side networking failure is never...
  • Commit c616970 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #2058645 by sun: Fixed cache IDs and ambiguous cache_clear_all()...