Commit Graph
878 Commits
Author SHA1 Message Date
Dang Dat 845161cb62 HOTFIX Sentry disable default replay 2026-05-07 15:33:14 +07:00
Dat H. Pham 5e1348f261 Fix sentry minified (#4481) 2026-05-05 14:19:28 +07:00
Dat Vu ba1ac18314 fix(logger): Reduce Sentry noise with targeted error logging (ADR-0076) (#4467) 2026-05-05 11:01:45 +07:00
Dat H. Pham b0e349029f fix(logging): minor issue for logging and docs 2026-04-28 11:31:12 +07:00
dab246 1a30b3f681 refactor(logging): rename handles() to canHandle() for clarity 2026-04-28 11:31:12 +07:00
dab246 86a3097f19 fix(sentry): wrap addBreadcrumb with unawaited to avoid blocking callers 2026-04-28 11:31:12 +07:00
dab246 6a6a9c2509 refactor(sentry): simplify _captureExceptionInternal by unifying withScope setup 2026-04-28 11:31:12 +07:00
dab246 26ed041e34 refactor(logging): pass LogRecord to handles() and add default implementation via acceptsLevel() 2026-04-28 11:31:12 +07:00
dab246 4c0fa41d5b refactor(logging): move LogRecord construction into LogRecord.build factory 2026-04-28 11:31:12 +07:00
dab246 c712c9b4b0 feat(logging): support multi-instance handlers via handlerKey
Add handlerKey to LogHandler so that two instances of the same concrete
class can coexist in AppLoggerRegistry (e.g. two ConsoleLogHandlers with
different formatters, or two Sentry handlers targeting different DSNs).

Default key is runtimeType.toString(), preserving existing dedup behaviour
for handlers that do not override it.

Also add @visibleForTesting on resetForTesting() and convert LogHandler
from abstract interface class to abstract class so the default handlerKey
implementation is inherited without requiring each implementor to redeclare it.
2026-04-28 11:31:12 +07:00
dab246 e84b621981 fix(logging): guard handles() in dispatch and replace stale handlers on re-register
- Wrap both handles() and handle() in a single try/catch so a throwing
  handles() cannot abort the pipeline or crash callers
- Replace existing handler by runtimeType instead of silently keeping
  the stale instance, so re-registering with a new config takes effect
- Add recursion-safety comment in SentryManager.addBreadcrumb catch
  block to lock in the invariant for future handler additions
2026-04-28 11:31:12 +07:00
dab246 6c5948557c fix(logging): isolate handler failures and fix fake reporter override
- Wrap each handler.handle() in try/catch so a failing handler does not
  abort the remaining handlers or bubble exceptions to callers
- Fix _FakeSentryReporter.addBreadcrumb signature to match SentryReporter
  interface (add level and category named parameters)
2026-04-28 11:31:12 +07:00
dab246 28000d4636 fix(logging): propagate level/category on breadcrumbs, align captureMessage signature
- addBreadcrumb gains level (default SentryLevel.debug) and category
  params in SentryReporter interface and SentryManager implementation;
  SentryBreadcrumbHandler passes level: SentryLevel.debug, category: 'log'
  so breadcrumbs on error events are clearly labelled in Sentry UI
- captureMessage param order aligned to {extras, level} in SentryManager
  to match the SentryReporter interface declaration
- Test: _FakeSentryReporter updated; new test case asserts level/category
2026-04-28 11:31:12 +07:00
dab246 1b4723ef05 fix(logging): restore per-call webConsoleEnabled as first-class flag
webConsoleEnabled was deprecated in favour of a global constructor flag,
but that removed the ability to force specific log calls visible on web
in release/profile mode — a legitimate need for auth and Sentry init
diagnostics.

Carry webConsoleEnabled through the full pipeline:
LogRecord → buildLogRecord → _dispatch → public log functions.
ConsoleLogHandler reads the flag from the record rather than from its
constructor, so per-call opt-in works independently of build mode.

On web:
- handles() always returns true (filter deferred to handle())
- handle() prints only when record.webConsoleEnabled || isDebugMode

Existing call sites (authorization_interceptors, sentry_config) that
pass webConsoleEnabled: true are preserved and functional again.
2026-04-28 11:31:12 +07:00
dab246 eb329d8a48 fix(logging): deprecate per-call webConsoleEnabled parameter
Web console output is now configured globally via ConsoleLogHandler
at startup. The parameter is retained for source compatibility.
2026-04-28 11:31:12 +07:00
dab246 29c89c34b2 fix(logging): pass SentryLevel through reporter interface
SentryReporter.captureException and captureMessage now accept a
SentryLevel parameter so handlers can forward the mapped severity.
SentryEventHandler maps Level.critical → fatal, Level.error → error.
SentryManager forwards the level via scope.level.
2026-04-28 11:31:12 +07:00
dab246 9876db67f8 feat(logger): add SentryEventHandler and SentryBreadcrumbHandler (ADR-0078)
refactor(logger): register Sentry handlers at startup for mobile and web (ADR-0078)
2026-04-28 11:31:12 +07:00
dab246 2633c774c5 refactor(sentry): extract SentryReporter interface for handler testability (ADR-0078) 2026-04-28 11:31:12 +07:00
dab246 8ff856b490 feat(sentry): add addBreadcrumb method to SentryManager (ADR-0078)
feat(logger): add SentryEventHandler and SentryBreadcrumbHandler (ADR-0078)
2026-04-28 11:31:12 +07:00
dab246 2e0f419281 refactor(logger): delegate app_logger public API to AppLoggerRegistry (ADR-0078) 2026-04-28 11:31:12 +07:00
dab246 9b6c768e69 refactor(logger): add AppLoggerRegistry dispatcher and ConsoleLogHandler (ADR-0078) 2026-04-28 11:31:12 +07:00
dab246 49a6b33baa refactor(logger): add LogFormatter interface and platform-specific formatters (ADR-0078) 2026-04-28 11:31:12 +07:00
dab246 3b42d3b873 refactor(logger): add LogRecord, LogHandler, Level core abstractions (ADR-0078) 2026-04-28 11:31:12 +07:00
dab246 0295334d8a TF-4269 Fix Sentry release version sync across platforms
Use --dart-define=SENTRY_RELEASE=<full-tag> in Fastlane so the app
reports the same version string to Sentry as CI uses when uploading
symbols, bypassing iOS CFBundleShortVersionString stripping.

- Android Fastfile: add --dart-define=SENTRY_RELEASE (build-name unchanged)
- iOS Fastfile: pass DART_DEFINES via xcargs (increment_version_number unchanged)
- Dart: read SENTRY_RELEASE dart-define first, fall back to PackageInfo.version
- NSE/Web unaffected: NSE reads from Keychain, Web falls back to PackageInfo
2026-04-22 15:41:28 +07:00
dab246 230cbf647f TF-4269 Integrate Sentry into iOS NSE and automate dSYM upload in CI 2026-04-22 15:41:28 +07:00
Dat Dang e3dfadce34 Upgrade Patrol to 4.5.0 (#4446) 2026-04-17 20:50:22 +07:00
Dat Dang 77e2381ca9 Upgrade Flutter to 3.38.9 (#4455) 2026-04-17 17:39:29 +07:00
dab246 660c4f40e2 TF-4301 Address code review comments on label feature
- Make LabelModalMixin interactor getters non-nullable; remove force-unwraps at call sites
- Show positiveLabel and add semanticLabel in progressing button for accessibility
- Use timestamp-based label name in E2E scenario to prevent flakiness on reused accounts
- Guard labelAs action with isLabelAvailable check in SingleEmailController
- Don't pop back on label creation failure so users can retry without losing context
- Block modal dismissal while label creation request is in flight
- Null-guard email.id before toggling label in ThreadView::onCreateANewLabelAction
- Log stackTrace and rethrow in DialogRouter to distinguish errors from user cancel
2026-04-17 11:58:53 +07:00
dab246 190ccc7bc3 TF-4301 Add "Create a new label" button in Label As menus and wire up tagging in email view 2026-04-17 11:58:53 +07:00
dab246 35b46ff21b TF-4308 Add NoLabelYetWidget for choose label modal
Signed-off-by: dab246 <tdvu@linagora.com>
2026-04-17 10:22:32 +07:00
Dat Dang 6fc88f780c TW-4308 Add labels for several messages part 2 (#4431)
Add ChooseLabelModal, delegate, and update label UI components

Wire add-labels action across Thread, Search, and Dashboard
2026-04-15 14:25:37 +07:00
dab246 eeaab49e93 TF-4268 Cache Sentry config and user for FCM background re-initialization
Signed-off-by: dab246 <tdvu@linagora.com>
2026-04-10 16:05:02 +07:00
Dat Vu c9e2e5db80 TF-4358 Remove mail in trash by default in search result (#4361) 2026-04-10 15:15:53 +07:00
dab246 c9ec1c2820 TF-4268 Improve SentryConfig and SentryManager: sampling, frames tracking, non-blocking capture 2026-04-09 14:16:41 +07:00
dab246 5e1d99125e TF-4265 Exclude our signature by add removeTMailSignature option to extractPlainText method 2026-04-07 13:20:25 +07:00
dab246 4c837ed9cf TF-4370 Add Description field to Create new Label modal 2026-03-25 19:45:46 +07:00
dab246 28d5036667 TF-4378 Migrate scribe-mobile branch to master branch 2026-03-25 11:52:35 +07:00
Théo Poizat 1e43ac510b Increase Scribe mobile inline button size 2026-03-25 11:52:35 +07:00
Théo Poizat 03a03b9088 Fix Scribe on responsive mobile
- Button was not added in MobileResponsiveAppBar
- Mobile behavior related scripts were not correctly added for web composer
- Mobile behavior related scripts return value was not properly handled for web composer
- In responsive web, bottomsheet modal clicks were intercepted by iframe behind
2026-03-25 11:52:35 +07:00
Théo Poizat 40030fe88e Properly escape HTML in every Scribe actions
In recent commits I separated how we could add text in the editor. So
we need to escape HTML in both method that add text:
insertTextInEditor and setTextInEditor.

I had to extract the HTML escape part of
convertTextContentToHtmlContent because when using setTextInEditor we
do not need to convert \n to <br>.
2026-03-25 11:52:35 +07:00
Théo Poizat b5606626f4 Fix more Scribe mobile issues
- Add getSavedSelection to check saved selection without consuming it
- Distinguish between setText (replace all) and insertText (at cursor) operations
- Fix replace callback to use setText when no selection exists
- Clean up saved selection state after restoration in HTML utils
- Move mobile editor focus and selection restore to appropriate callbacks
2026-03-25 11:52:35 +07:00
Théo Poizat be7f28f270 Fix Scribe mobile issues
- Fix Scribe replace on mobile when opened from menu bar (to be complete
this fix needs this PR https://github.com/Enough-Software/enough_html_editor/pull/37)
- Ensure all mobile editor call are awaited
- Do not clear text if a selection has been restored (which mean we replace a selection)
- Avoid collapseToEnd crash
2026-03-25 11:52:35 +07:00
Théo Poizat 84176cb113 Hide keyboard and selection icons when Scribe mobile modal opened
When opening Scribe mobile modal, we now unfocus the composer to hide the keyboard and the selection start and end icons from the OS.

Add new methods to save, restore, and clear text selection in HTML editor. These methods allow preserving and restoring user selection state when opening the Scribe mobile modal so that the "replace" action still works.
2026-03-25 11:52:35 +07:00
Théo Poizat 09fe002d3c Use proper icons and styles for bottomsheet icons in Scribe 2026-03-25 11:52:35 +07:00
Théo Poizat 03c70922a0 Fix selection coordinates in mobile
Because the HTML editor is different, we need a different selector to get the editable element.

We also need to add a small offset to the coordinates to avoid positionning the overlay icon above native selection UI in mobile. For example, Android adds a marker at the beginning and the end of the selection and we do not want to display the Scribe overlay icon above this marker.
2026-03-25 11:52:35 +07:00
Dat H. Pham 3e39f59f20 Fixup Constant some token exception 2026-03-10 11:06:16 +07:00
dab246 437c46f5ff fix(sentry): resolve minified exception types on web release 2026-03-10 11:06:16 +07:00
dab246 2e8a11e7eb refactor(sentry): standardize exceptions to prevent Sentry minification 2026-03-10 11:06:16 +07:00
dab246 296548a781 fix(sentry): sync dist parameter to resolve minified stack traces 2026-03-10 11:06:16 +07:00
Dat Vu 9cd75b2885 TF-4339 Fix CORS issue on openid-configuration call (#4342) 2026-02-23 17:18:20 +07:00