Skip to content

caching for get_href / get_versionless_href mixes data between these calls #10355

@jennifer-richards

Description

@jennifer-richards

Describe the issue

The DocumentInfo_get_href() helper caches its result, but it does not segregate the cache between different values of its meeting_doc_refs parameter. As a result, DocumentInfo.get_href() and DocumentInfo.get_versionless_href() return incorrect values if calls to them are interleaved.

E.g., using an arbitrary agenda:

>>> from ietf.doc.models import *
>>> ag = Document.objects.filter(type_id="agenda", group__acronym="asdf").last()
>>> ag.get_href()
'https://datatracker.ietf.org/meeting/interim-2026-asdf-02/materials/agenda-interim-2026-asdf-02-asdf-01-00'
>>> ag.get_versionless_href()
'https://datatracker.ietf.org/meeting/interim-2026-asdf-02/materials/agenda-interim-2026-asdf-02-asdf-01-00'
>>>

Note that these are both the same and end with -01-00. Now restart the interpreter and...

>>> from ietf.doc.models import *
>>> ag = Document.objects.filter(type_id="agenda", group__acronym="asdf").last()
>>> ag.get_versionless_href()
'https://datatracker.ietf.org/meeting/interim-2026-asdf-02/materials/agenda-interim-2026-asdf-02-asdf-01'
>>> ag.get_href()
'https://datatracker.ietf.org/meeting/interim-2026-asdf-02/materials/agenda-interim-2026-asdf-02-asdf-01'
>>>

again both the same, but without the final -00!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions