UI5 / UI5/openui5

Changes Marked as Pending After User Restores Original Value (updateGroup)

Open
#4,175 6 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
3.3k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Description:
When using an OData V4 model with two-way binding and an updateGroup, if a user changes a property and then manually sets it back to its original value, hasPendingChanges() still returns true. This results in unnecessary backend requests, even though there are no actual modifications left.

Steps to Reproduce:

  1. Configure an OData V4 Binding with an updateGroup.
  2. Bind (e.g., value of Input) to an OData V4 model property using two-way binding.
  3. Change the input’s value from the original (e.g., "ABC") to a new value (e.g., "DEF").
  4. Change the input’s value back to the original value ("ABC").
  5. Call hasPendingChanges().

Expected Behavior:

  • After restoring the original value, hasPendingChanges() should return false.
  • No unnecessary backend requests should occur if no effective changes remain.

Actual Behavior:

  • After restoring the original value, hasPendingChanges() returns true.
  • Unnecessary backend requests are triggered when submitting the updateGroup changes.

Impact:

  • Causes redundant server requests and additional load.
  • Confuses users and developers, suggesting data is still modified.
  • Complicates the process of batching changes.

Environment:

  • UI5 version: 1.120.8
  • OData V4 Backend: RAP with CDS

Additional Notes:

  • Manual handling or resetting changes is required as a workaround.

Requested Fix:

  • Improve the internal change tracking for updateGroup scenarios so that restoring a property to its original value is correctly recognized as no pending change.
  • Ensure hasPendingChanges() accurately reflects actual modifications.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.