NodeBB / NodeBB/nodebb-plugin-customize

Diff becomes outdated if original template is changed/updated

Open
#10 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

This may be functioning as intended, but I wanted to raise it nonetheless.

When a customized template is added, two values are saved into the database, old and diff, referring to the original template, and the changes made.

If the underlying template gets changed, old and diff no longer reflect the proper changeset, and could cause issues if the original template contains breaking changes. This is because diff is applied onto old, and then saved to the templates folder, so it will never inherit the updated template.

e.g.

  • Persona templates/partials/chats-menu.tpl contained changes, it now contains tabs and shows profile options, notifications, as well as chats.
  • If that partial was changed in any way, chats-menu.tpl will always contain the old modified template, and will not inherit any new changes to that partial.

Contributor guide

No contributing guide indexed for this repository

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 by tracing how the customized template values old and diff are stored and applied to files in the templates folder, using templates/partials/chats-menu.tpl as the example. The work is done when an updated original template can be combined with the customization without restoring the outdated version or losing the intended changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
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.