Skip to content

Public API to invalidate or replace a cached mod template without bumping settingsVersion #3

Description

@przemyslaw-zan

Use case:

  • Start the game in language X and register the mod template through setModTemplate(linkage, template, callback).
  • Close the game, switch to language Y, and start the game again.
  • Our mod now resolves language Y at runtime, but ModsSettingsApi still shows the cached language X template.

Observed behavior:

  • The stale template survives a full client restart and language change.
  • Calling setModTemplate() again with the same linkage is not enough to replace it.
  • In practice, the only reliable way we found to switch the configurator text from X to Y is bumping our internal settingsVersion.

Why this is hard for mod authors:

  • settingsVersion looks like a schema/versioning field, but today it also acts as the only public cache-busting mechanism for title/tooltip/option-text changes.
  • We would prefer not to bump it for every localization fix or packaging mistake.

Requested API:

  • A public way to invalidate or replace the cached template for one linkage, for example:
    • invalidateModTemplate(linkage)
    • refreshModTemplate(linkage, template, callback=None, buttonHandler=None)
    • or a force=True option on setModTemplate()

The important part is being able to replace the persisted template cache for an existing linkage without having to artificially increase settingsVersion.

If this is intentionally unsupported, it would still help to document that settingsVersion is the expected cache-busting mechanism for any template text change, not only schema changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions