Issue 12584 no automatic refetch - #193
Merged
Merged
Conversation
…)` #12584
The most common use case for `modelService.delete()` is from a page
detail, and after deletion the user is redirected to the page listing.
So there is no need to `refetchObservableQueries()` unconditionally.
# Other use cases
For other use cases we can reload specific queries like those
examples.
## Dialog
From a dialog on top of the listing page:
```ts
this.itemService
.delete([id], {
// Wait till we refresh the list under the dialog before closing the dialog, to avoid re-clicking on the just deleted item
refetchQueries: [itemsQuery],
awaitRefetchQueries: true,
})
.subscribe({
next: () => {
this.alertService.info(`Supprimé`);
this.dialogRef.close();
}
});
```
## Inline deletion in listing
From a listing page where deletion is directly accessible on the row:
```ts
this.itemService.delete([id], {
refetchQueries: [itemsQuery],
}).subscribe({
next: () => {
this.alertService.info(`Supprimé`);
},
error: () => this.deleting.delete(id),
});
```
## Bulk deleting
Bulk deleting via `NaturalAbstractList.bulkDelete()` still automatically
refetch the listing of items, but no other queries anymore.
…)` #12584
The most common use case for `modelService.create()` is from a page
detail for creation, and after the creation the user is redirected
to the page detail for edition. So there is no need to
`refetchObservableQueries()` unconditionally.
# Other use cases
For other use cases we can reload specific queries like those
examples.
## Dialog
From a dialog on top of the listing page:
```ts
this.itemService
.create({...}, {
// Refresh the list under the dialog
refetchQueries: [itemsQuery]
})
.subscribe(newItem => {
this.alertService.info('Créé');
this.dialogRef.close(newItem);
});
```
## Inline creation in listing
From a listing page where row creation is inline, there is nothing to do,
because the row already exists before we even mutate the server.
There was a problem hiding this comment.
Pull request overview
This PR appears to address “Issue 12584 no automatic refetch” by updating the @ecodev/natural and @ecodev/natural-editor dependencies to 72.0.0-alpha.4 (and corresponding lockfile changes), plus a small related cleanup in e2e utilities and a simplification of the permissions configuration for esbuild.
Changes:
- Bump
@ecodev/naturaland@ecodev/natural-editorto72.0.0-alpha.4(and updatepnpm-lock.yamlaccordingly). - Update
pnpm-lock.yamlsnapshot/package entries (includingprosemirror-viewpatch bump to1.42.2). - Simplify
configuration/Permissions.phpby replacing runtimefindlogic with a static path pattern foresbuild. - Remove an unused
DocumentNodeimport from@apollo/client/coreine2e/utils.ts(usinggraphql’sDocumentNodeinstead).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pnpm-lock.yaml |
Lockfile updates for @ecodev/natural* 72.0.0-alpha.4 and related dependency resolution changes. |
package.json |
Pins @ecodev/natural and @ecodev/natural-editor to 72.0.0-alpha.4. |
e2e/utils.ts |
Removes the redundant DocumentNode import from Apollo core; continues using graphql’s DocumentNode. |
configuration/Permissions.php |
Replaces dynamic esbuild path discovery with a static node_modules/**/bin/esbuild entry. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
…)` do not `refetchObservableQueries()` #12584
The most common use case for `modelService.updateNow()`, and variants,
is from a page detail for edition. The update mutation itself already
fetches the very few fields that are server computed and should
be refetched. So there is no need to `refetchObservableQueries()`
unconditionally.
# Other use cases
For other use cases we can reload specific queries like those
examples.
## Dialog
From a dialog on top of the listing page:
```ts
this.itemService
.updateNow({...}, {
// Wait till we refresh the list under the dialog before closing the dialog, to avoid re-clicking on the just updated item
refetchQueries: [itemsQuery],
awaitRefetchQueries: true
})
.subscribe(newItem => {
this.alertService.info('Mis à jour');
this.dialogRef.close(newItem);
});
```
## Inline update in listing
From a listing page where row update is inline, there is nothing to do,
because the row already is up to date before we even mutate the server.
## Bulk updating
Bulk updating is extremely rare in our projects, and should be treated
on a case by base basis.
Drop unused `BookingWithOwnerService.terminateBooking()` #12584
Drop debug code #12584
PowerKiKi
force-pushed
the
issue-12584-no-automatic-refetch
branch
from
August 3, 2026 09:39
c193af0 to
d5e6695
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.