• Robert Knight's avatar
    Fix canceling edits reverting to the first-loaded version of an annotation · 3d9d84ff
    Robert Knight authored
    When updating an annotation, the update is currently applied
    to a copy of the domain model. AIUI the rationale for this is to ensure
    that 'domainModel' always reflects what is actually stored on the
    server, so it should not be updated until after the update is
    successfully committed.
    
    However, after the update is successfully commited, the view was
    updated with the updated domain model, but the local domain model
    instance was never replaced. Therefore when reverting changes,
    the card reverted to the first-loaded text for the annotation
    instead of the last-saved version.
    
    This commit fixes the problem by replacing the domain model
    reference whenever an annotation update is received.
    
    Fixes #2875
    3d9d84ff
annotation-test.js 59.9 KB