loopbackio / loopbackio/loopback-datasource-juggler

Use operation hooks instead of deprecated model hooks

Open
#1,097 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

major
Dominant language
JavaScript
Stars
282
Forks
366
Avg merge
17h 4m
Merged PRs (30d)
10

Description

See the discussion in #824. We were not able to remove deprecated model hooks because embedded relations are still relying on them.

There is a feature for inst.triggerParent in embedsMany that needs more consideration and possibly a rewrite for embedded relations to continue work. It is for updating the parent model if any changes are made to the relation. This part needs a redesign and rewrite to consider the different cases and to make it all consistent.

We should rewrite inst.triggerParent to not depend on deprecated hooks, for example using the approach outlined in https://github.com/strongloop/loopback-datasource-juggler/commit/d0cc791bc65e5ee7d2447698539da1d1ca0591ee

cc @jannyHou @Amir-61 @superkhau

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.

Research direction

Start with the discussion in #824 and inspect the embedded-relation path around inst.triggerParent. Compare its current behavior with the approach in commit d0cc791bc65e5ee7d2447698539da1d1ca0591ee. Done means embedded relations still update their parent consistently without relying on deprecated model hooks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.