Skip to content

Do not rely on indexes when retrieving context rows #371

@julen

Description

@julen

Context row retrieval relies on unit indexes within a store, and fetches the before/after units for a unit as shown in the following snippet: https://github.com/evernote/zing/blob/e937daa01a8eff24c21a04ba0aacf79138d1a65a/pootle/apps/pootle_store/views.py#L200-L209

The code expects units to have consecutive indexing, but that's not always true for live, non-obsolete units.

So this becomes problematic especially in stores with larger amounts of units, because chances are higher units will become obsolete at a certain point in time, which leaves gaps between indexes. For users, the end result is that irrelevant units end up being displayed as context units.

All in all we need to change how retrieval is done to avoid relying on indexes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions