apache / apache/ponymail-foal

plugins.database.py callers do not discriminate real errors

Open
#104 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
45
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Callers of the plugins.database methods generally treat all errors the same as a 404.

This means that more serious errors can be missed.

Many ES commands always return a successful HTTP status, so any errors should be regarded as fatal.

For the few (e.g. GET) that can return a 4xx status, this should be explicitly checked, rather than assuming any error is 404.

In classic PonyMail, this was done by the elastic.lua interface, so callers did not have to concern themselves with this ES-specific detail.

I think it would make sense to do the checks at a lower level than currently, so the main logic does not have to concern itself with such detail.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the callers of plugins.database.py and compare their error handling with the classic elastic.lua interface mentioned in the issue. Trace how Elasticsearch responses are classified, then verify that fatal errors are not treated as 404s while valid GET 4xx responses remain explicitly handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, python
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.