[pull] main from TryGhost:main#1221
Merged
Merged
Conversation
closes https://linear.app/ghost/issue/NY-1316 - `day_diff(date_from, date_to)` ran whenever `date_from` was defined, so a request with `date_from` but no `date_to` threw a 400 error. These errors don't come from the Ghost frontend - we always send `date_to` to this endpoint - but requests directly to this endpoint were hitting the error - every other stats endpoint (via `filtered_sessions`) already defaults a missing `date_to` to today; api_kpis intended to as well but the day_diff guard broke that - added `defined(date_to)` to the `day_diff` checks so a missing `date_to` falls through to the existing `today()` default instead of erroring
towards https://linear.app/ghost/issue/NY-1321 *This change should have no user impact.* Before this change, we fetched an array of settings but only grabbed the first. After this change, we just fetch the setting we need. I think this is useful on its own, but also makes [an upcoming change][0] easier. [0]: https://linear.app/ghost/issue/NY-1321
The User model didn't declare `filterRelations` for the roles relation, so NQL emitted `roles.name:[...]` filters as a WHERE clause with no JOIN to `roles_users` or `roles`. MySQL and SQLite both rejected the query. In createCustomNotification's alert branch, the worker runs with `rethrowErrors: true`, so the SQL error escaped the wrapping try/catch and exited the function before notifications.add was called. The alert email and the in-app banner were both silently dropped. Declared the missing filterRelations on the User model. The update-check service uses the natural NQL filter directly. Added an integration test that drives the full path through a real worker spawn and model layer, asserting the notification is persisted in settings.notifications. Rewrote the unit test to assert outcomes (recipient, subject, content, persisted shape) instead of pinning the exact call signature to api.users.browse.
ref #24536 Removes `ghost/admin/mirage/fixtures/timezones.js`, which is dead code.
no ref In Portal, clicking on "Powered by Ghost" could open up two browser tabs due to it being an anchor tag with a redundant `onClick` handler doing the same.
run-update-check.js initialised permissions, settings, and tiers in the worker thread but never called emailAddress.init(). Worker threads have their own require cache, so the main process's init in boot.js doesn't propagate. When the alert branch reached ghostMailer.send → getFromAddress, accessing emailAddress.service.defaultFromEmail threw because service was undefined. The error escaped the alert try/catch via rethrowErrors: true and exited the function before notifications.add was called, dropping both the banner and the email. Added emailAddress.init() to the worker's init sequence. Strengthened the integration test to activate the Owner fixture so users.browse returns a recipient and the worker exercises notificationEmailService.send end-to-end. Routed the worker's mailer to nodemailer-stub-transport via process.env so it doesn't try to connect to localhost SMTP. The previous test shape silently dropped to the to.length === 0 early-return and missed the regression.
…nt tab (#24626) no ref Clicking "Contact support" in Portal triggers two navigation attempts: one from the `href` attribute (which navigates in the current tab) and one from the `onClick` handler (new tab). The new tab opens correctly, but the current-tab attempt fails in the iframe context, resulting in an error.
…18188) no issue Updated Ghost's error messages when creating a user password (in Admin) to clarify the 'rules' rather than guesswork. These aren't necessary to keep vague as they don't allow for enumeration, such as entering in usernames.
no ref This test-only change should have no user impact. Koenig's test utilites now use TypeScript.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )