Skip to content

Sometimes strings updated by WebUI are not picked up by mf() on the server #267

@merio

Description

@merio

Using preview 23, sometimes when a string is changed through the Web UI, any call to mf() on the server doesn't pick up the changes and uses the string cached in mfPkg.compiled.

I've tracked down the bug and it looks like this happens if a string has an mtime less than the updatedAt of its language at the moment of the change. Doing some debugging using node inspector on the server, the changed function in ObserveFrom never gets triggered:

}, changed: function(doc) {

I guess this is because the actual string is not observed for changes since its not observed by the query, which is constrained by the mtime calculated previously

var query = {mtime: {$gt: mtime}};

For now, as a workaround, I'm adding an observer for the whole collection in /lib at the moment of initialization and copying the added/changed functions from msgfmt.js, but of course that's suboptimal and not really sure if it could have any side effect.

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