Problem/Motivation
The tests are currently failing for D8.1. This is caused by an exception thrown in honeypot_get_time_limit(): it tries to query the flood table to see how often an anonymous user has been caught in the honeypot trap. However, the flood table is not created until the first event is registered, causing the query to fail.
Proposed resolution
Unfortunately, the default Flood implementation does not have a getCount() function, and ensureTableExists() is private, so the proposed solution is to catch the exception, and if the flood table does not exist, assume number of captures == 0.
Alternatively, we could check if the table exists prior to querying, but this would add a database roundtrip to each request for anonymous users.
Longer term we should get rid of the query on the flood table, since it is a swappable service and info might be stored elsewhere. This issue is just to get the tests back to green though, so I'll open a separate issue for that.
Remaining tasks
Review the patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | honeypot-flood-exception-2.patch | 1.83 KB | mr.baileys |
honeypot-flood-exception.patch | 1.81 KB | mr.baileys | |
Comments
Comment #2
mr.baileysFixed a documentation issue.
Comment #3
mr.baileysAdded #2674008: Remove usage of Flood service from Honeypot, if that lands, the tests should automatically be green and this patch is no longer needed.
Comment #4
geerlingguy CreditAttribution: geerlingguy as a volunteer commentedClosing in favor of #2674008: Remove usage of Flood service from Honeypot.
Comment #6
geerlingguy CreditAttribution: geerlingguy as a volunteer commentedBad testbot :P