Skip to content

Commit bdbc86c

Browse files
authored
Merge pull request #399 from bitfinexcom/staging
Release version 4.26.0
2 parents 126e9fb + ecdce1d commit bdbc86c

11 files changed

Lines changed: 147 additions & 19 deletions

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.26.0] - 2024-08-28
11+
12+
### Added
13+
14+
- Added ability to send `IPC` messages when the sync is ready. PR: [bfx-reports-framework#405](https://github.com/bitfinexcom/bfx-reports-framework/pull/405)
15+
- Added ability to show native notifications in case another screen is displayed and the app window is not hidden with multiple workspaces mode in `Ubuntu`/`Mac`. PR: [bfx-report-electron#389](https://github.com/bitfinexcom/bfx-report-electron/pull/389)
16+
- Added ability to show the native notification in the electron app in case the `sync` is being processed in the background with the hidden main window. There we check if the main window is invisible and show a notification otherwise don't. PR: [bfx-report-electron#390](https://github.com/bitfinexcom/bfx-report-electron/pull/390)
17+
18+
### Changed
19+
20+
- Enhanced and unified `Logins` and `Change Logs` reports column configuration getters and reduced redundant code. PR: [bfx-report-ui#840](https://github.com/bitfinexcom/bfx-report-ui/pull/840)
21+
- Reworked and optimized the `TimeFrameSelector` component in a more performant way and reduced redundant code. PR: [bfx-report-ui#841](https://github.com/bitfinexcom/bfx-report-ui/pull/841)
22+
- Reworked cell generation configurations more concisely and optimally for `Wallets`, `Weighted Averages` and `Concentration Risk` reports. PR: [bfx-report-ui#842](https://github.com/bitfinexcom/bfx-report-ui/pull/842)
23+
- Reworked and optimized `LedgersCategorySelect` in a more concise and performant way. PR: [bfx-report-ui#843](https://github.com/bitfinexcom/bfx-report-ui/pull/843)
24+
- Reworked and optimized `Movements`, `Trades`, `Orders` and `Positions` reports column configuration getters. Implemented unified `getFeeCell` and `getActionCell` helpers for better reusability. PR: [bfx-report-ui#844](https://github.com/bitfinexcom/bfx-report-ui/pull/844)
25+
- Reworked `CandlesTimeframe` in a more performant way and improved props linting. PR: [bfx-report-ui#845](https://github.com/bitfinexcom/bfx-report-ui/pull/845)
26+
- Enhanced and unified `Snapshots` sections column configuration getters and reduced redundant code. PR: [bfx-report-ui#846](https://github.com/bitfinexcom/bfx-report-ui/pull/846)
27+
- Removed deprecated methods and fields without breaking the logic and UI functionality. PRs: [bfx-report#389](https://github.com/bitfinexcom/bfx-report/pull/389), [bfx-reports-framework#403](https://github.com/bitfinexcom/bfx-reports-framework/pull/403)
28+
- Improved DB file cleanups for test coverage hooks. PRs: [bfx-report#390](https://github.com/bitfinexcom/bfx-report/pull/390), [bitfinexcom/lokue#3](https://github.com/bitfinexcom/lokue/pull/3)
29+
- Removed unused public colls conf accessor endpoints to use the common `getAllPublicCollsConfs`/`editAllPublicCollsConfs` ones without breaking the logic and UI functionality. PR: [bfx-reports-framework#404](https://github.com/bitfinexcom/bfx-reports-framework/pull/404)
30+
- Implemented a class for DB models to typify and unify model objects. PR: [bfx-reports-framework#406](https://github.com/bitfinexcom/bfx-reports-framework/pull/406)
31+
- Proxied `ENet` error tester for import in electron env. PR: [bfx-reports-framework#407](https://github.com/bitfinexcom/bfx-reports-framework/pull/407)
32+
33+
### Fixed
34+
35+
- Extended network error processing. Related to these issues: [bfx-report-electron#396](https://github.com/bitfinexcom/bfx-report-electron/issues/396), [bfx-report-electron#274](https://github.com/bitfinexcom/bfx-report-electron/issues/274). PR: [bfx-report#392](https://github.com/bitfinexcom/bfx-report/pull/392)
36+
- Improved the tax report ccy conversion by adding `6` retries with `10sec` delay for getting `pub-trades` if returns non-array. PR: [bfx-reports-framework#402](https://github.com/bitfinexcom/bfx-reports-framework/pull/402)
37+
- Extended network error processing and prevented showing the error modal dialog. Related to these issues: [bfx-report-electron#396](https://github.com/bitfinexcom/bfx-report-electron/issues/396), [bfx-report-electron#274](https://github.com/bitfinexcom/bfx-report-electron/issues/274). PR: [bfx-report-electron#397](https://github.com/bitfinexcom/bfx-report-electron/pull/397)
38+
1039
## [4.25.0] - 2024-07-31
1140

1241
### Added

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,14 @@ npm run launch -- -aop
161161
```
162162

163163
> Also, we provide [GitHub Actioins workflows](https://docs.github.com/en/actions/using-workflows/about-workflows) configs for automated building and publishing of the Electron app artifacts using the above-described scripts `./scripts/launch.sh` and `./scripts/build-release.sh`, see the corresponding file `.github/workflows/build-electron-app.yml`
164+
165+
## Locations of ElectronJS App files on different OSs
166+
167+
- Logs:
168+
- Ubuntu: `~/.config/Bitfinex Report/logs`
169+
- Windows: `C:\Users\$username\AppData\Roaming\Bitfinex Report\logs`
170+
- Mac: ElectronJS logs: `~/Library/Logs/Bitfinex Report` and app logs `~/Library/Application Support/Bitfinex Report/logs`
171+
- DB files `db-sqlite_sync_m0.db`, `db-sqlite_sync_m0.db-shm` (optional), `db-sqlite_sync_m0.db-wal` (optional):
172+
- Ubuntu: `~/.config/Bitfinex Report`
173+
- Windows: `C:\Users\$username\AppData\Roaming\Bitfinex Report`
174+
- Mac: `~/Library/Application Support/Bitfinex Report`

bfx-reports-framework

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bfx-report-electron",
3-
"version": "4.25.0",
3+
"version": "4.26.0",
44
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
55
"description": "Reporting tool",
66
"author": "bitfinex.com",

server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ const allowedProcessMessagesSet = _getAllowedStatesSet({
6161
'READY_TRX_TAX_REPORT',
6262
'ERROR_TRX_TAX_REPORT',
6363

64+
'READY_SYNC',
65+
'ERROR_SYNC',
66+
6467
'ALL_TABLE_HAVE_BEEN_CLEARED',
6568
'ALL_TABLE_HAVE_NOT_BEEN_CLEARED',
6669

src/error-manager/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const cleanStack = require('clean-stack')
66

77
const isDevEnv = process.env.NODE_ENV === 'development'
88

9+
const { isENetError } = require(
10+
'../../bfx-reports-framework/workers/loc.api/helpers/api-errors-testers'
11+
)
12+
913
const log = require('./log')
1014
const getErrorDescription = require('./get-error-description')
1115
const showModalDialog = require('./show-modal-dialog')
@@ -216,8 +220,8 @@ const initLogger = () => {
216220
* - GitHub server can't respond to the auto-update requests
217221
*/
218222
if (
223+
isENetError(error) ||
219224
/Cannot download differentially/gi.test(error) ||
220-
/ERR_CONNECTION_REFUSED/gi.test(error) ||
221225
/objects\.githubusercontent\.com/gi.test(error) ||
222226
/Error: ERR_FAILED \(-2\) loading 'file:.*\.html'/gi.test(error) ||
223227
/Failed to generate PDF/gi.test(error)

src/helpers/manage-window.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,16 @@ const centerWindow = (win, workArea) => {
111111
win.setBounds(boundsOpts)
112112
}
113113

114+
const isWindowInvisible = (win) => {
115+
return (
116+
!win?.isVisible() ||
117+
!win?.isFocused()
118+
)
119+
}
120+
114121
module.exports = {
115122
hideWindow,
116123
showWindow,
117-
centerWindow
124+
centerWindow,
125+
isWindowInvisible
118126
}

src/manage-worker-messages.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ const showMessageModalDialog = require(
1010
const isMainWinAvailable = require(
1111
'./helpers/is-main-win-available'
1212
)
13-
const { showWindow } = require('./helpers/manage-window')
14-
const showNotification = require('./show-notification')
13+
const {
14+
showWindow
15+
} = require('./helpers/manage-window')
16+
const showTrxTaxReportNotification = require(
17+
'./show-notification/show-trx-tax-report-notification'
18+
)
19+
const showSyncNotification = require(
20+
'./show-notification/show-sync-notification'
21+
)
1522
const PROCESS_MESSAGES = require(
1623
'../bfx-reports-framework/workers/loc.api/process.message.manager/process.messages'
1724
)
@@ -238,19 +245,16 @@ module.exports = (ipc) => {
238245
ipc.send({ state: PROCESS_STATES.REMOVE_ALL_TABLES })
239246
}
240247
if (
241-
(
242-
state === PROCESS_MESSAGES.READY_TRX_TAX_REPORT ||
243-
state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT
244-
) &&
245-
!wins?.mainWindow?.isVisible()
248+
state === PROCESS_MESSAGES.READY_TRX_TAX_REPORT ||
249+
state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT
246250
) {
247-
const isError = state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT
248-
const body = isError
249-
? 'An unexpected error occurred while generating the tax report!'
250-
: 'Your tax report is ready!'
251-
const urgency = isError ? 'critical' : 'normal'
252-
253-
showNotification({ body, urgency })
251+
showTrxTaxReportNotification(mess)
252+
}
253+
if (
254+
state === PROCESS_MESSAGES.READY_SYNC ||
255+
state === PROCESS_MESSAGES.ERROR_SYNC
256+
) {
257+
showSyncNotification(mess)
254258
}
255259
} catch (err) {
256260
console.error(err)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'use strict'
2+
3+
const PROCESS_MESSAGES = require(
4+
'../../bfx-reports-framework/workers/loc.api/process.message.manager/process.messages'
5+
)
6+
const wins = require('../windows')
7+
const { isWindowInvisible } = require('../helpers/manage-window')
8+
const showNotification = require('./')
9+
10+
const getBody = (params) => {
11+
const {
12+
isError,
13+
isInterrupted
14+
} = params ?? {}
15+
16+
if (isError) {
17+
return 'Data sync completed with an error!'
18+
}
19+
if (isInterrupted) {
20+
return 'Data sync interrupted!'
21+
}
22+
23+
return 'Data sync completed successfully!'
24+
}
25+
26+
module.exports = (mess) => {
27+
const {
28+
state = '',
29+
data = {}
30+
} = mess ?? {}
31+
32+
if (!isWindowInvisible(wins?.mainWindow)) {
33+
return
34+
}
35+
36+
const isError = state === PROCESS_MESSAGES.ERROR_SYNC
37+
const isInterrupted = !!data?.isInterrupted
38+
39+
const body = getBody({ isError, isInterrupted })
40+
const urgency = isError ? 'critical' : 'normal'
41+
42+
showNotification({ body, urgency })
43+
}

0 commit comments

Comments
 (0)