Fix a few misc exceptions sent to Sentry

This commit is contained in:
Ben Gotow 2025-02-02 20:18:58 -06:00
parent cb02bf1000
commit 3cde64fcd5
6 changed files with 31 additions and 11 deletions

View file

@ -2,10 +2,9 @@ name: Build for macOS
on:
workflow_dispatch:
branches: master
jobs:
build:
build-macos:
strategy:
matrix:
# Confusingly, macos-13 is intel and macos-latest is ARM
@ -14,8 +13,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Fail if branch is not main
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master'
run: |
echo "This workflow should not be triggered with workflow_dispatch on a branch other than main"
exit 1
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache NodeJS modules
uses: actions/cache@v4

View file

@ -12,8 +12,6 @@ This is a patch release that resolves several user-reported issues. Thank
- The RPM build no longer generate build_id links to prevent conflicts when installing multiple Electron apps.
# versions of electron apps
## 1.15.0
Happy 2025! This version of Mailspring upgraedes the app to Electron 33 and Chromium 130, ensuring the latest upstream bug fixes, security patches and improvements are available in the app.

View file

@ -75,7 +75,7 @@ class ContactDetailWithFocus extends React.Component<ContactDetailProps, Contact
const contact =
editing === 'new' && 'accountId' in perspective
? emptyContactForAccountId(perspective.accountId)
: contacts.find(c => c.id === focusedId);
: contacts?.find(c => c.id === focusedId);
if (!contact) {
return { metadata: null, data: null, contact: null };

View file

@ -150,7 +150,7 @@ export class TranslateMessageHeader extends React.Component<
callCldViaExtension(text, (err, result) => {
if (err || !result || !result.languages?.length) {
console.warn(`Could not detect message language: ${err.toString()}`);
console.warn(`Could not detect message language: ${err?.toString()}`);
return;
}
if (!this._mounted) {

View file

@ -157,6 +157,10 @@ export default class AppEnvConstructor {
if (!originalError && !message) return;
if (!originalError) originalError = new Error(`${message}`);
if (`${originalError}`.toLowerCase().includes('resizeobserver')) {
return; // happens infrequently, but errors a zillion times - too noisy for Sentry
}
if (!this.inDevMode()) {
return this.reportError(originalError, { url, line, column });
}
@ -403,7 +407,8 @@ export default class AppEnvConstructor {
if (process.platform === 'linux') {
const dimensions = this.getWindowDimensions();
const display =
require('@electron/remote').screen.getDisplayMatching(dimensions) || require('@electron/remote').screen.getPrimaryDisplay();
require('@electron/remote').screen.getDisplayMatching(dimensions) ||
require('@electron/remote').screen.getPrimaryDisplay();
const x = display.bounds.x + (display.bounds.width - dimensions.width) / 2;
const y = display.bounds.y + (display.bounds.height - dimensions.height) / 2;
@ -781,7 +786,10 @@ export default class AppEnvConstructor {
}
async showOpenDialog(options: Electron.OpenDialogOptions, callback: (paths: string[]) => void) {
const result = await require('@electron/remote').dialog.showOpenDialog(this.getCurrentWindow(), options);
const result = await require('@electron/remote').dialog.showOpenDialog(
this.getCurrentWindow(),
options
);
callback(result.filePaths);
}
@ -789,7 +797,10 @@ export default class AppEnvConstructor {
if (options.title == null) {
options.title = 'Save File';
}
const result = await require('@electron/remote').dialog.showSaveDialog(this.getCurrentWindow(), options);
const result = await require('@electron/remote').dialog.showSaveDialog(
this.getCurrentWindow(),
options
);
callback(result.filePath);
}
@ -811,7 +822,9 @@ export default class AppEnvConstructor {
let winToShow = null;
if (showInMainWindow) {
winToShow = require('@electron/remote').getGlobal('application').getMainWindow();
winToShow = require('@electron/remote')
.getGlobal('application')
.getMainWindow();
}
if (!detail) {

View file

@ -465,6 +465,10 @@ export class ImageAttachmentItem extends Component<ImageAttachmentItemProps> {
imgEl = parent.querySelector('.file-preview img') as HTMLImageElement,
editor = this._editor();
if (!editor) {
return;
}
this._pData = { x: ev.pageX, y: ev.pageY, eH: editor.clientHeight };
this._shiftData.held = ev.shiftKey;
this._shiftData.ratio = { wh: imgEl.width / imgEl.height, hw: imgEl.height / imgEl.width };