Commit Graph
28967 Commits
Author SHA1 Message Date
Lucie GermainandClaude Opus 5 9cf4fa8bf5 [web] gracefully handle failed oauth token exchange for reference managers (#36377)
* [web] gracefully handle failed oauth token exchange for reference managers

Mendeley/ReadCube redirect back to /:ref_provider/oauth/token-exchange with
`error` and `error_description` instead of `code` when a user declines consent.
completeAuth forwarded the whole query string on to third-party-references,
whose strict zod schema (d8c1679bb08) accepts only oauth_token, oauth_verifier
and code, so the exchange failed and the user got a 500.

The same forwarding also sent `state` on every callback, success or failure.
`state` is web's own CSRF token and is never read by third-party-references, so
it tripped the log-only schema on every single token exchange, and would have
broken linking outright under REQ_VALIDATION_MODE=enforce.

Forward only the credentials the exchange needs, and show a translated
notification in the Reference managers section rather than erroring. Validate
ref_provider against the known providers so the provider name can be
interpolated into the message without reflecting a URL segment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* [web] fix providerName argument and validate before deriving refProvider

Address Copilot review on #36377:

- The token-exchange failure handler passed `false` positionally into the
  `providerName` slot of _redirectWithLinkingError, so a failed exchange would
  have rendered "your false account". Pass providerName and an explicit false.
- _getRefProviderBackendKey(req) ran before parseReq, so refProvider was derived
  from raw, unvalidated req.params. Parse first and derive from the validated
  params via _toRefProviderBackendKey; _getRefProviderBackendKey now delegates
  to it so the other handlers are unchanged.

The completeAuth tests kept their assertions inside ctx.res.callback without
awaiting the controller, so the callback fired after the test had already
returned and the assertions were never enforced — which is why the suite was
green with the providerName bug in it. Await the controller and assert inline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* [web] add logOnly to the completeAuth schema and guard the provider lookup

logOnly returns the raw input on a schema failure, so ref_provider can be an
arbitrary URL segment. Check it against the display-name table rather than
trusting the schema: unknown providers 404 in both validation modes, and
providerName is guaranteed non-null for the rest of the handler.

Also covers the schema half under REQ_VALIDATION_MODE=enforce, so dropping
ref_provider from completeAuthSchema fails a test rather than passing unnoticed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitOrigin-RevId: b98eb5414fe8b672f44aab8c3690f7637d434cd2
2026-09-17 11:51:27 +00:00
Rebeka Dekany 6e57b24811 Record a metric for Stripe API request statuses to monitor rate limiting (#35779)
* Record a metric for Stripe API request statuses to monitor rate limiting

* Add on() stub to Stripe mock in StripeClient unit tests

* Record the Stripe rate-limit reason for 429 responses

* Add acceptance test for Stripe rate-limit reason metric

GitOrigin-RevId: 1674b389f5a7fee403f980b6e813a3e2df81063c
2026-09-17 11:51:23 +00:00
Olzhas Askar b4880f691e Merge pull request #36346 from overleaf/oa-fix-counts
[web] Fix counts

GitOrigin-RevId: b1ec87eb19d41c897b205d2ff178ab2b600fb987
2026-09-17 11:51:17 +00:00
Andrew Rumble 66355e4372 Merge pull request #36361 from overleaf/ar-fix-postdoc-validation-errors
[docstore][document-updater] fix POST doc validation errors

GitOrigin-RevId: 9b5fbc667a3b56b30077ea8de9d81c17253db273
2026-09-17 11:51:12 +00:00
Alf EatonandClaude Opus 4.8 98842d4659 Add Draw mode to the symbol palette (#34868)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
GitOrigin-RevId: 4ea4f97023e65fdb8b018f610f77d7dd107c8e76
2026-09-17 11:51:03 +00:00
Alf EatonandClaude Fable 5 10f10ca95f Only show "Jump to command definition" for right-click on command name (#36191)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
GitOrigin-RevId: 05811783a327fb641f6c677eaa1efeb8a87668fc
2026-09-17 11:50:57 +00:00
roo hutton 1681343782 Merge pull request #36024 from overleaf/rh-cio-group-support
Enable customer.io in-app messages on group management pages

GitOrigin-RevId: 0c30c4ccf219cdbc4dd48ea6940cc46a4c6964c3
2026-09-17 11:50:54 +00:00
Kristina c628d82f07 [web] rm 30s filter for connection-restored events (#36315)
* rm 30s filter for `connection-restored` events
* rm unnecessary lastOutageRef
* stop sending idle events

GitOrigin-RevId: 6ff228c878496ad25bc8cc4c1acb4da5a88dce15
2026-09-17 11:50:51 +00:00
Jakob Ackermann 975cf90357 [editor-core] gracefully handle any legacy v1 import agent (#36354)
GitOrigin-RevId: 186afa70c03e69b3288af66d85a0a3e431780d14
2026-09-17 11:50:47 +00:00
Mathias Jakobsen f7de42f1d3 Merge pull request #36181 from overleaf/mj-offline-mode-feature
[web] Add offline mode to feature set

GitOrigin-RevId: 93d2ed373af5b46f5ead924c14605775826c46e3
2026-09-17 11:50:44 +00:00
Malik Glossop 42feabe643 Merge pull request #35907 from overleaf/mg-ai-usage-event
Fire a 'ai-usage-limit-reached' event in backend

GitOrigin-RevId: b43babdd2a0146086cee5ebd2bde83f8daaf1bb5
2026-09-17 11:50:38 +00:00
Malik Glossop e567abe71a Merge pull request #36105 from overleaf/mg-focus-floating-menu
Hide floating menu and comment context menu item in focus mode

GitOrigin-RevId: 4cc55f5cebae5e88ea1d1c03a9ac270e43c3073e
2026-09-17 11:50:35 +00:00
Olzhas Askar f513b1aa52 Merge pull request #36302 from overleaf/oa-teardown-trial-ineligible-cta
[web] Teardown trial ineligible cta

GitOrigin-RevId: 4d114943bc2839b29b6eae3a133d6c235f98ffcc
2026-09-17 11:50:24 +00:00
Olzhas Askar 58d76ff1a0 Merge pull request #36247 from overleaf/oa-wider-panel
[web] Wider checkout panel

GitOrigin-RevId: ea9edafa4e11b0b04d5a74c664781c3dd0cc5e87
2026-09-17 11:50:20 +00:00
Maria Florencia Besteiro Gonzalez 6b7a77b4b2 Merge pull request #36239 from overleaf/mfb-show-duplicate-in-visual-bib-editor
Show duplicate entries in visual bib editor

GitOrigin-RevId: 32e4e41a751624a2142c7fd2c5e5de5a5d3905f5
2026-09-17 11:50:14 +00:00
Andrew Rumble d43b9d12ba Merge pull request #36071 from overleaf/ar-node-24.18.1
[monorepo] upgrade node to 24.18.1

GitOrigin-RevId: f6857b443d3e7882567d3cb62fa884dce2368191
2026-09-17 11:50:11 +00:00
roo hutton ba589211ea Merge pull request #36314 from overleaf/revert-36194-rh-cio-split-tests
Revert "[web] send active split test assignments to customer.io"

GitOrigin-RevId: c3acb504be2ef003d6a103568ece3175f787e6d5
2026-09-17 11:50:08 +00:00
roo hutton 6b69ea7dc1 Merge pull request #36194 from overleaf/rh-cio-split-tests
[web] send active split test assignments to customer.io

GitOrigin-RevId: 3036d6442e8419326f4b641482d65bd5114fe3da
2026-09-17 11:49:59 +00:00
Brian Gough df7a9159c2 normalise image counts in compile-with-optimizable-pngs analytics events (#36308)
GitOrigin-RevId: 6049161196fab1b2e4c3d9aa811b97e3e529aca2
2026-09-17 11:49:54 +00:00
Tom Wells 88fb4c48b2 Merge pull request #36290 from overleaf/copilot/update-library-empty-state-illustration
Update library items for better guidance

GitOrigin-RevId: 15f60589f721a8243110dda58ef7b1134e2c5275
2026-09-17 11:49:50 +00:00
Antoine ClausseandMathias Jakobsen 87fd22cefc [web] Fix negative AI quota countdown after reset period elapses (#35690)
* Fix negative AI quota countdown after reset period elapses

Backend (`FeatureUsageRateLimiter`, `TokenUsageRateLimiter`): once the
24h period had lapsed, `remainingUsage`/`remainingTokens` reset to the
full allowance but `resetDate` kept pointing at the old `periodStart +
24h` (i.e. in the past). Advance to `now + 24h` in that case.

Frontend (`NewPlanPaywall`, `ErrorGetPremium`): the "wait X hours and Y
minutes" copy computed `restoreTime - now` without clamping, so a past
`restoreTime` produced negative hours/minutes (users saw "wait -118
hours and -35 minutes"). Clamp to 0.

* Address PR review on quota reset fix

- Keep `resetDate` tied to the stored `periodStart + PERIOD` rather
  than jumping to `now + PERIOD` when the period has lapsed. The
  moving-target variant unnecessarily reinterpreted a stable field
  (existing consumers such as `use-ai-access-gate` check whether the
  reset date is in the past).
- Clamp `remainingUsage` / `remainingTokens` at 0 so a concurrent
  over-usage never leaks a negative count.
- Align the boundary check with `_checkRateLimit` / `checkUsage`
  (inclusive `<=`).
- Cover the period boundary and the clamp in unit tests for both
  `FeatureUsageRateLimiter` and `WorkbenchRateLimiter`.

* Truncate test fixtures to whole seconds

`resetDate` is serialized with `Date.toString()`, which has second
resolution, so fixtures with a millisecond component failed the
boundary assertions.

* Revert code changes; keep tests that document the bug

The fixes masked the symptom (negative countdown) without addressing
the underlying issue, and it is not fully understood yet. Revert the
rate limiters and the writefull paywall components to their original
behaviour, and instead pin the current behaviour in tests:

- `it.fails` tests document that `remainingUsage`/`remainingTokens`
  go negative when usage exceeds the allowance — these flip red when
  the bug is fixed, at which point they should become plain `it`.
- The lapsed-period tests assert (with explanatory comments) that
  `resetDate` keeps pointing at the end of the lapsed period, which is
  the server-side ingredient of the negative-countdown support ticket.

* Reapply quota fixes

Restores the post-review state of the rate limiters (clamp remaining
counts at 0, inclusive period boundary, resetDate tied to periodStart)
and the writefull paywall components (clamp countdown at 0).

Tests intentionally untouched in this commit; the two `it.fails` tests
now need flipping to plain `it` in a follow-up.

* Flip bug-documenting tests to plain assertions

The clamp fixes are reapplied, so the `it.fails` tests now assert the
fixed behaviour directly. Trim the explanatory comments.

* Set resetDate to `Date.now() + PERIOD_IN_MILLISECONDS` instead of the expired/stale date.

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>

* Update lapsed-period tests for the fresh resetDate

`resetDate` is now `Date.now() + PERIOD` once the period has lapsed, so
assert an approximately-fresh date instead of the stale period end.

---------

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>
GitOrigin-RevId: ad39627ab9e5ceccb2a61443b2b7d39c68600594
2026-09-17 11:49:47 +00:00
Brian Gough 6b3d95cea4 add optimisable png count and compile stats to compile-with-optimizable-pngs event (#36279)
* add count of optimisable pngs to HistoryResourceWriter

* add optimisable png count and compile stats to compile-with-optimizable-pngs event

GitOrigin-RevId: 5c528d727473ec2d3082845d8d5b60844f3434f6
2026-09-17 11:49:41 +00:00
Anna Claire Fields b8339c5b4a history-v1: handle ERR_STREAM_PREMATURE_CLOSE in streamZip (#36135)
GitOrigin-RevId: 963b65583da58034afe304206f6e0c66e9186b06
2026-09-17 11:49:33 +00:00
Andrew Rumble d9e7900246 Merge pull request #35553 from overleaf/copilot/fix-split-test-calculator-event-suggestions
Fix split-test calculator event suggestions by scoping event queries and deduping in-flight lookups

GitOrigin-RevId: 2afebbd645218770cb3a8fbd615038df215dd9ed
2026-09-17 11:49:27 +00:00
Mathias Jakobsen 77f208633b Merge pull request #36233 from overleaf/mj-command-palette-events
[web] Add events to command palette usage

GitOrigin-RevId: 1bb40c20f3228027ee4470dc84fa2983bb910cbf
2026-09-17 11:49:19 +00:00
David 3325724a9e Merge pull request #36258 from overleaf/dp-fix-library-badge
Use feature flag config for library badge rather than hard-coding

GitOrigin-RevId: a53bd7c739d2d8e6c5dbd5bda1fbc3a87f87b280
2026-09-17 11:49:12 +00:00
Jakob Ackermann 49969f6e0d [history-v1] adopt strict zod types and extend test coverage (#36089)
GitOrigin-RevId: 7bdffe2c05c7c17be6eb3e4296d8df05d650c53e
2026-09-17 11:49:08 +00:00
roo hutton b886c0b266 Merge pull request #35836 from overleaf/rh-prices-split
[web] Update monthly plan prices for new subscriptions with split test

GitOrigin-RevId: 42d0adaf68647adc93f4c05d5ddeefb356753db2
2026-09-17 11:49:04 +00:00
Kristina 2e1a313ccd [web] resize mentions dropdown styles (#36172)
GitOrigin-RevId: e0f4ff0d51f168569ad54fa896ab25c399278ebb
2026-09-17 11:48:53 +00:00
Kristina c5f3726eda [web] update comment placeholder for mentions (#36167)
GitOrigin-RevId: c702e00004d8dfcf243425503459f558973a657b
2026-09-17 11:48:50 +00:00
Jakob Ackermann 95e3444a6e [editor-core] refine zod schemas for rawTextOperation and rawFileMetadata (#36253)
* [editor-core] gracefully handle no-op TextOperation

* [editor-core] add support for legacy url imports

* [editor-core] reorder rawFileMetadata entries

GitOrigin-RevId: f5c3158def00183d4a60a5b934abd921716e2339
2026-09-17 11:48:47 +00:00
Jakob Ackermann b4937905bb [linked-url-proxy] adopt strict zod types and extend test coverage (#36166)
GitOrigin-RevId: 1edbd4ea3240cc8973d0a7e6488a8b882422a42b
2026-09-17 11:48:43 +00:00
Jakob Ackermann 2e8f6f0d03 [chat] adopt strict zod types (#36102)
GitOrigin-RevId: eb3e245599f5db2d29366ce5d8e0993ec6b20338
2026-09-17 11:48:40 +00:00
Jakob Ackermann 4e79741e78 [latexqc] integrate latexqc closer into build scripts (#36252)
* [monorepo] drop unused --docker-repos build script flag

* [latexqc] integrate latexqc closer into build scripts

- Generate Dockerfile
- Drop now unused --only-jenkins-include-file

* [monorepo] update header for custom Dockerfiles in build scripts

GitOrigin-RevId: 84d0b100e731ae41db132f676e7837e17c17542e
2026-09-17 11:48:37 +00:00
Jakob Ackermann 4e6e98941a [latexqc] adopt strict zod types and extend test coverage (#36165)
GitOrigin-RevId: 339aa5c5b51dc2ab97178e482142f64d7324a57b
2026-09-17 11:48:33 +00:00
Jakob Ackermann a80f9d4803 [github-sync] adopt strict zod types and extend test coverage (#36050)
GitOrigin-RevId: cd4060778455e9bc252588e449d5588852648592
2026-09-17 11:48:27 +00:00
Jakob Ackermann 6ca58edf72 [web] add infrastructure level zod change (#36190)
* [web] add infrastructure level zod change

* [web] set req validation mode for tests to 'enforce'

GitOrigin-RevId: 6dbc8bff7ed9f89045c398df93d84bca589de4e9
2026-09-17 11:48:19 +00:00
Antoine Clausse 86bab9dc99 Merge pull request #35724 from overleaf/ac-wallet-payment-method-analytics
[web] Add Stripe wallet payments (Apple Pay / Google Pay) in analytics and remove conversion to "card"

GitOrigin-RevId: f6d404d35eb108d7ddaf8ca1b6c2164cb5100c9c
2026-09-17 11:48:15 +00:00
Jakob Ackermann 731ed50f78 [clsi] address zod violations (#36199)
* [editor-core] gracefully handle no-op TextOperation

* [web] avoid sending sync to pdf requests without a ?file

* [validation-tools] log deeper nested violations

* [editor-core] fix round trip of EditNoOperation

* [web] use custom error for sync to pdf w/o file, fix tests

* [validation-tools] include request params in log msg for violation

* Revert "[editor-core] gracefully handle no-op TextOperation"

This reverts commit c1d37261d5db72b37dbf39428c54edcfb5423f41.

* [web] gracefully handle rejected sync to pdf from context menu

GitOrigin-RevId: 21de7dc96b23575b0d67b6eb0c68ed9c2f86292b
2026-09-17 11:48:12 +00:00
David 761d4efc1f Merge pull request #36114 from overleaf/dp-merge-library-bibtex-flags
Merge bibtex-visual-editor into overleaf-library feature flags

GitOrigin-RevId: 26f8325d68367d0e33236e9f92ab6dc76f76987d
2026-09-17 11:48:08 +00:00
Davinder Singh a0c923aea8 fix download filename in unable-to-sync modal error message (#36113)
GitOrigin-RevId: fdc891962b24a096a1d54a73fcb0d7af6d504729
2026-09-17 11:48:02 +00:00
Davinder SinghandMathias Jakobsen b04bdd2944 [WEB] Only show affected lines plus one above/below in the diff viewer (#36052)
* adding trimmed diff view with context lines in unable-to-sync modal

* addressing co pilot comments

* Update services/web/frontend/js/features/ide-react/components/modals/diff-viewer.tsx

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>

---------

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>
GitOrigin-RevId: de5a01048b0609288acf01196ff0a0f069e8bed3
2026-09-17 11:47:59 +00:00
Davinder Singh 98b79d9532 [WEB] Simplify "New project" dropdown (#34290)
* Simplify the new project dropdown

* Simplify the New project dropdown

* removing artefact of rebase

GitOrigin-RevId: e7e4dc48c10f2297abcd7c5b489ff2308bf9e18b
2026-09-17 11:47:56 +00:00
Jakob Ackermann deec57e54e [chat] gracefully handle projects without threads/messages when cloning (#36101)
GitOrigin-RevId: 0623a4b801f469b7d55412f2be8aac782cb6ab19
2026-09-17 11:47:52 +00:00
Jimmy Domagala-Tang 560b7a209a Transition optimized images to project-level toggle (#36093)
* feat: transitioning optimized images from a compile mode to a project level toggle. We still persist it for the proect and between users, and ensure that draft mode does not interact with it (silently disabled while draft mode is on)

* feat: cleaning up unused var, tests, and locales

* feat: updating copy

GitOrigin-RevId: 8010edfab164980f14125739e481d8b512f6b3df
2026-09-17 11:47:49 +00:00
Olzhas Askar 49747e61c9 Merge pull request #36163 from overleaf/oa-cookie-banner
[web] Rephrase the cookie banner

GitOrigin-RevId: 229cf5ead3d6a9f7c8fa1b8dda45508b06b23c42
2026-09-17 11:47:40 +00:00
Brian GoughandCopilot Autofix powered by AI a9a36237aa Use logger.exit in expire-deleted user/project scripts (#36169)
* add logger.exit method to avoid logs being lost by process.exit

* use logger.exit in expire deleted projects and users scripts

* improve comment for EXIT_DELAY

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* convert to async

* await logger.exit in expire deleted projects and users scripts

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
GitOrigin-RevId: 020d5cc2755871e5343130029706fe3b1c8e15ee
2026-09-17 11:47:35 +00:00
Mathias Jakobsen 43ea352733 Merge pull request #36185 from overleaf/mj-cmd-plt-fixes
[web] Tweak command palette

GitOrigin-RevId: f69cf1f24dadecd81b4c563d289cbffc5ef4788f
2026-09-17 11:47:29 +00:00
Jakob Ackermann 4ca028cb4c [validation-tools] eventName: accept upper case letters (#36188)
GitOrigin-RevId: 979ec5c744d5304232d447ff5fff076ee081721f
2026-09-17 11:47:25 +00:00
Kristina f179e89c0c [web] add analytics for @mentions (#36144)
GitOrigin-RevId: 9fb1447166eb5ee82867466abc9af2207c886f8b
2026-09-17 11:47:22 +00:00