Notification emails for manually-tracked GitHub projects link to "undefined"
-
Read against
eb9d805.sendNotificationEmailbuildsversionLinkfrom the project type, atbackend/tasks.js:266—if (project.type === database.PROJECT_TYPE_GITHUB) { versionLink = `https://github.com/${project.name}/releases/tag/${release.version}`; } else if (project.type === database.PROJECT_TYPE_GITLAB) {PROJECT_TYPE_GITHUB_MANUAL('github_manual',database.js:11) is a separate constant and is never tested, soversionLinkstays undefined for every manually-added GitHub project.Result:
- text body:
Read more about this release at undefined(tasks.js:278) - HTML body:
<a href="undefined">(notification.template:78)
Repro: add a GitHub project via the "track manually" path rather than starring it, then wait for a release notification.
syncReleasesByProjectalready treats both constants as GitHub (tasks.js:152-155), which is what makes this look like an oversight rather than intent.One-line fix:
--- a/backend/tasks.js +++ b/backend/tasks.js @@ -264,7 +264,7 @@ async function sendNotificationEmail(release) { })); let versionLink; - if (project.type === database.PROJECT_TYPE_GITHUB) { + if (project.type === database.PROJECT_TYPE_GITHUB || project.type === database.PROJECT_TYPE_GITHUB_MANUAL) { versionLink = `https://github.com/${project.name}/releases/tag/${release.version}`; } else if (project.type === database.PROJECT_TYPE_GITLAB) { versionLink = `${project.origin}/${project.name}/-/tags/${release.version}`;One question while I'm here: is
git.cloudron.iothe canonical repo now? The GitHub mirror is archived, so I could not open an issue or a PR there, and I could not check GitLab without an account. Line numbers above are against the mirror, so worth a sanity check if the code has moved. - text body:
-
J joseph moved this topic from Apps
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login