FLUID-6424: Material arriving through contextualised relay rule does not trigger model listener in init transaction

Metadata

Source
FLUID-6424
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Antranig Basman
Created
2019-11-05T17:03:03.685-0500
Updated
2024-07-22T10:35:20.567-0400
Versions
N/A
Fixed Versions
  1. 4.0
Component
  1. Framework

Description

This is only an issue affecting the work in progress FLUID-6148 branch. During our reimplementation of fluid.notifyInitModel we have managed to swap the order of effects so that any material arriving in a component's model purely via relays does not end up triggering modelListeners. This was found when continuing to modernise the gpii-app code which contains definitions like so:

fluid.defaults("gpii.qss.buttonPresenter", {
    ...
        modelRelay: {
            title: {
                target: "title",
                singleTransform: {
                    type: "fluid.transforms.free",
                    func: "gpii.qss.buttonPresenter.getTitle",
                    args: [
                        "{gpii.qss}.model.isKeyedIn",
                        "{that}.model.item.schema.title"
                    ]
                }
            }
        },
        modelListeners: {
            title: {
                "this": "{that}.dom.title",
                method: "text",
                args: ["{change}.value"]
            },

Comments

  • Antranig Basman commented 2019-11-05T18:58:08.026-0500

    Note that this issue only actually affects "contextualised" relays such as the fluid.transform.free block shown - direct or implicit relays get played through the relay system live, whereas contextualised relays such as above only get played after the conclusion of a "half-transaction" triggered by modelTransaction.commit().

  • Antranig Basman commented 2019-11-06T07:07:50.180-0500

    Looks like this was not an issue in the old framework because of the old crude "initModelEvent" system which always notified via creating a fresh blank transaction with the original model value.