Skip to content

Issue 12584 no automatic refetch - #193

Merged
PowerKiKi merged 4 commits into
masterfrom
issue-12584-no-automatic-refetch
Aug 3, 2026
Merged

Issue 12584 no automatic refetch#193
PowerKiKi merged 4 commits into
masterfrom
issue-12584-no-automatic-refetch

Conversation

@PowerKiKi

Copy link
Copy Markdown
Member

No description provided.

…)` #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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/natural and @ecodev/natural-editor to 72.0.0-alpha.4 (and update pnpm-lock.yaml accordingly).
  • Update pnpm-lock.yaml snapshot/package entries (including prosemirror-view patch bump to 1.42.2).
  • Simplify configuration/Permissions.php by replacing runtime find logic with a static path pattern for esbuild.
  • Remove an unused DocumentNode import from @apollo/client/core in e2e/utils.ts (using graphql’s DocumentNode instead).

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
PowerKiKi force-pushed the issue-12584-no-automatic-refetch branch from c193af0 to d5e6695 Compare August 3, 2026 09:39
@PowerKiKi
PowerKiKi merged commit d5e6695 into master Aug 3, 2026
5 checks passed
@PowerKiKi
PowerKiKi deleted the issue-12584-no-automatic-refetch branch August 3, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants