Skip to content

Commit 3cde64f

Browse files
committed
Fix a few misc exceptions sent to Sentry
1 parent cb02bf1 commit 3cde64f

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

.github/workflows/build-macos.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ name: Build for macOS
22

33
on:
44
workflow_dispatch:
5-
branches: master
65

76
jobs:
8-
build:
7+
build-macos:
98
strategy:
109
matrix:
1110
# Confusingly, macos-13 is intel and macos-latest is ARM
@@ -14,8 +13,14 @@ jobs:
1413
runs-on: ${{ matrix.os }}
1514

1615
steps:
16+
- name: Fail if branch is not main
17+
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master'
18+
run: |
19+
echo "This workflow should not be triggered with workflow_dispatch on a branch other than main"
20+
exit 1
21+
1722
- name: Checkout Repo
18-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
1924

2025
- name: Cache NodeJS modules
2126
uses: actions/cache@v4

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ This is a patch release that resolves several user-reported issues. Thank
1212

1313
- The RPM build no longer generate build_id links to prevent conflicts when installing multiple Electron apps.
1414

15-
# versions of electron apps
16-
1715
## 1.15.0
1816

1917
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.

app/internal_packages/contacts/lib/ContactDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ContactDetailWithFocus extends React.Component<ContactDetailProps, Contact
7575
const contact =
7676
editing === 'new' && 'accountId' in perspective
7777
? emptyContactForAccountId(perspective.accountId)
78-
: contacts.find(c => c.id === focusedId);
78+
: contacts?.find(c => c.id === focusedId);
7979

8080
if (!contact) {
8181
return { metadata: null, data: null, contact: null };

app/internal_packages/translation/lib/message-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class TranslateMessageHeader extends React.Component<
150150

151151
callCldViaExtension(text, (err, result) => {
152152
if (err || !result || !result.languages?.length) {
153-
console.warn(`Could not detect message language: ${err.toString()}`);
153+
console.warn(`Could not detect message language: ${err?.toString()}`);
154154
return;
155155
}
156156
if (!this._mounted) {

app/src/app-env.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ export default class AppEnvConstructor {
157157
if (!originalError && !message) return;
158158
if (!originalError) originalError = new Error(`${message}`);
159159

160+
if (`${originalError}`.toLowerCase().includes('resizeobserver')) {
161+
return; // happens infrequently, but errors a zillion times - too noisy for Sentry
162+
}
163+
160164
if (!this.inDevMode()) {
161165
return this.reportError(originalError, { url, line, column });
162166
}
@@ -403,7 +407,8 @@ export default class AppEnvConstructor {
403407
if (process.platform === 'linux') {
404408
const dimensions = this.getWindowDimensions();
405409
const display =
406-
require('@electron/remote').screen.getDisplayMatching(dimensions) || require('@electron/remote').screen.getPrimaryDisplay();
410+
require('@electron/remote').screen.getDisplayMatching(dimensions) ||
411+
require('@electron/remote').screen.getPrimaryDisplay();
407412
const x = display.bounds.x + (display.bounds.width - dimensions.width) / 2;
408413
const y = display.bounds.y + (display.bounds.height - dimensions.height) / 2;
409414

@@ -781,15 +786,21 @@ export default class AppEnvConstructor {
781786
}
782787

783788
async showOpenDialog(options: Electron.OpenDialogOptions, callback: (paths: string[]) => void) {
784-
const result = await require('@electron/remote').dialog.showOpenDialog(this.getCurrentWindow(), options);
789+
const result = await require('@electron/remote').dialog.showOpenDialog(
790+
this.getCurrentWindow(),
791+
options
792+
);
785793
callback(result.filePaths);
786794
}
787795

788796
async showSaveDialog(options: Electron.SaveDialogOptions, callback: (path: string) => void) {
789797
if (options.title == null) {
790798
options.title = 'Save File';
791799
}
792-
const result = await require('@electron/remote').dialog.showSaveDialog(this.getCurrentWindow(), options);
800+
const result = await require('@electron/remote').dialog.showSaveDialog(
801+
this.getCurrentWindow(),
802+
options
803+
);
793804
callback(result.filePath);
794805
}
795806

@@ -811,7 +822,9 @@ export default class AppEnvConstructor {
811822

812823
let winToShow = null;
813824
if (showInMainWindow) {
814-
winToShow = require('@electron/remote').getGlobal('application').getMainWindow();
825+
winToShow = require('@electron/remote')
826+
.getGlobal('application')
827+
.getMainWindow();
815828
}
816829

817830
if (!detail) {

app/src/components/attachment-items.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ export class ImageAttachmentItem extends Component<ImageAttachmentItemProps> {
465465
imgEl = parent.querySelector('.file-preview img') as HTMLImageElement,
466466
editor = this._editor();
467467

468+
if (!editor) {
469+
return;
470+
}
471+
468472
this._pData = { x: ev.pageX, y: ev.pageY, eH: editor.clientHeight };
469473
this._shiftData.held = ev.shiftKey;
470474
this._shiftData.ratio = { wh: imgEl.width / imgEl.height, hw: imgEl.height / imgEl.width };

0 commit comments

Comments
 (0)