musora-content-services 2.148.0 → 2.150.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.coderabbit.yaml +0 -0
- package/.editorconfig +0 -0
- package/.github/pull_request_template.md +0 -0
- package/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/docs.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +0 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- package/jest.config.js +0 -0
- package/package.json +1 -1
- package/src/constants/award-assets.js +0 -0
- package/src/constants/membership-permissions.ts +0 -0
- package/src/contentMetaData.js +0 -0
- package/src/filterBuilder.js +0 -0
- package/src/infrastructure/http/HttpClient.ts +0 -0
- package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
- package/src/infrastructure/http/index.ts +0 -0
- package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
- package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
- package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
- package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
- package/src/lib/ads/monoid.ts +0 -0
- package/src/lib/ads/semigroup.ts +0 -0
- package/src/lib/brands.ts +0 -0
- package/src/lib/lastUpdated.js +0 -0
- package/src/lib/sanity/field-access.ts +0 -0
- package/src/lib/sanity/filter.ts +0 -0
- package/src/lib/sanity/query.ts +0 -0
- package/src/services/api/types.js +0 -0
- package/src/services/api/types.ts +0 -0
- package/src/services/awards/award-callbacks.js +0 -0
- package/src/services/awards/award-query.js +0 -0
- package/src/services/awards/internal/.indexignore +0 -0
- package/src/services/awards/internal/award-definitions.js +0 -0
- package/src/services/awards/internal/award-events.js +0 -0
- package/src/services/awards/internal/award-manager.js +0 -0
- package/src/services/awards/internal/certificate-builder.js +0 -0
- package/src/services/awards/internal/content-progress-observer.js +0 -0
- package/src/services/awards/internal/image-utils.js +0 -0
- package/src/services/awards/internal/types.js +0 -0
- package/src/services/awards/types.d.ts +0 -0
- package/src/services/awards/types.js +0 -0
- package/src/services/content/artist.ts +0 -0
- package/src/services/content/content.ts +0 -0
- package/src/services/content/genre.ts +0 -0
- package/src/services/content/instructor.ts +0 -0
- package/src/services/content-org/content-org.js +0 -0
- package/src/services/content-org/guided-courses.ts +0 -0
- package/src/services/content-org/learning-paths.ts +0 -0
- package/src/services/content-org/playlists-types.js +0 -0
- package/src/services/content-org/playlists.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/dataContext.js +0 -0
- package/src/services/dateUtils.js +0 -0
- package/src/services/eventsAPI.js +0 -0
- package/src/services/forums/categories.ts +0 -0
- package/src/services/forums/forums.ts +0 -0
- package/src/services/forums/posts.ts +0 -0
- package/src/services/forums/threads.ts +0 -0
- package/src/services/forums/types.ts +0 -0
- package/src/services/gamification/awards.ts +0 -0
- package/src/services/gamification/gamification.js +0 -0
- package/src/services/imageSRCBuilder.js +0 -0
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/liveTesting.ts +0 -0
- package/src/services/permissions/PermissionsAdapter.ts +0 -0
- package/src/services/permissions/PermissionsAdapterFactory.ts +0 -0
- package/src/services/permissions/PermissionsV1Adapter.ts +0 -0
- package/src/services/permissions/PermissionsV2Adapter.ts +0 -0
- package/src/services/permissions/README.md +0 -0
- package/src/services/permissions/index.ts +0 -0
- package/src/services/progress-events.js +0 -0
- package/src/services/progress-row/base.js +0 -0
- package/src/services/progress-row/rows/.indexignore +0 -0
- package/src/services/progress-row/rows/content-card.js +25 -37
- package/src/services/progress-row/rows/method-card.js +0 -0
- package/src/services/progress-row/rows/playlist-card.js +0 -0
- package/src/services/railcontent.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/reporting/README.md +0 -0
- package/src/services/reporting/reporting.ts +0 -0
- package/src/services/reporting/types.ts +0 -0
- package/src/services/sentry/.indexignore +0 -0
- package/src/services/sentry/index.ts +0 -0
- package/src/services/state.ts +0 -0
- package/src/services/sync/.indexignore +0 -0
- package/src/services/sync/adapters/sqlite.ts +0 -0
- package/src/services/sync/context/index.ts +0 -0
- package/src/services/sync/context/providers/base.ts +0 -0
- package/src/services/sync/context/providers/connectivity.ts +0 -0
- package/src/services/sync/context/providers/durability.ts +0 -0
- package/src/services/sync/context/providers/index.ts +0 -0
- package/src/services/sync/context/providers/session.ts +0 -0
- package/src/services/sync/context/providers/tabs.ts +0 -0
- package/src/services/sync/context/providers/visibility.ts +0 -0
- package/src/services/sync/database/factory.ts +0 -0
- package/src/services/sync/effects/index.ts +0 -0
- package/src/services/sync/effects/logout-warning.ts +0 -0
- package/src/services/sync/effects/push-failure-notification.ts +0 -0
- package/src/services/sync/errors/boundary.ts +0 -0
- package/src/services/sync/errors/index.ts +8 -0
- package/src/services/sync/errors/validators.ts +0 -0
- package/src/services/sync/fetch.ts +0 -0
- package/src/services/sync/index.ts +0 -0
- package/src/services/sync/manager.ts +4 -0
- package/src/services/sync/models/Base.ts +0 -0
- package/src/services/sync/models/ContentLike.ts +0 -0
- package/src/services/sync/models/ContentProgress.ts +0 -0
- package/src/services/sync/models/Practice.ts +0 -0
- package/src/services/sync/models/PracticeDayNote.ts +0 -0
- package/src/services/sync/models/UserAwardProgress.ts +0 -0
- package/src/services/sync/models/index.ts +0 -0
- package/src/services/sync/repositories/base.ts +0 -0
- package/src/services/sync/repositories/content-likes.ts +0 -0
- package/src/services/sync/repositories/content-progress.ts +0 -0
- package/src/services/sync/repositories/index.ts +0 -0
- package/src/services/sync/repositories/practice-day-notes.ts +0 -0
- package/src/services/sync/repositories/practices.ts +0 -0
- package/src/services/sync/repositories/user-award-progress.ts +0 -0
- package/src/services/sync/repository-proxy.ts +0 -0
- package/src/services/sync/resolver.ts +0 -0
- package/src/services/sync/retry.ts +0 -0
- package/src/services/sync/run-scope.ts +5 -3
- package/src/services/sync/schema/index.ts +0 -0
- package/src/services/sync/serializers/index.ts +0 -0
- package/src/services/sync/serializers/model.ts +0 -0
- package/src/services/sync/serializers/raw.ts +0 -0
- package/src/services/sync/store/index.ts +3 -1
- package/src/services/sync/store/push-coalescer.ts +0 -0
- package/src/services/sync/store-configs.ts +0 -0
- package/src/services/sync/strategies/base.ts +0 -0
- package/src/services/sync/strategies/index.ts +0 -0
- package/src/services/sync/strategies/initial.ts +0 -0
- package/src/services/sync/strategies/polling.ts +0 -0
- package/src/services/sync/telemetry/flood-prevention.ts +0 -0
- package/src/services/sync/telemetry/index.ts +0 -0
- package/src/services/sync/telemetry/sampling.ts +0 -0
- package/src/services/sync/utils/event-emitter.ts +0 -0
- package/src/services/sync/utils/index.ts +0 -0
- package/src/services/sync/utils/throttle.ts +0 -0
- package/src/services/sync/utils/timers.ts +0 -0
- package/src/services/urlBuilder.ts +0 -0
- package/src/services/user/chat.js +0 -0
- package/src/services/user/interests.js +0 -0
- package/src/services/user/management.js +0 -0
- package/src/services/user/memberships.ts +0 -0
- package/src/services/user/notifications.js +0 -0
- package/src/services/user/payments.ts +0 -0
- package/src/services/user/permissions.js +0 -0
- package/src/services/user/sessions.js +0 -0
- package/src/services/user/streakCalculator.ts +0 -0
- package/src/services/user/types.d.ts +0 -0
- package/src/services/user/types.js +0 -0
- package/src/services/user/user-management-system.js +0 -0
- package/test/HttpClient.test.js +0 -0
- package/test/awards/award-alacarte-observer.test.js +0 -0
- package/test/awards/award-auto-refresh.test.js +0 -0
- package/test/awards/award-calculations.test.js +0 -0
- package/test/awards/award-certificate-display.test.js +0 -0
- package/test/awards/award-collection-edge-cases.test.js +0 -0
- package/test/awards/award-collection-filtering.test.js +0 -0
- package/test/awards/award-completion-flow.test.js +0 -0
- package/test/awards/award-exclusion-handling.test.js +0 -0
- package/test/awards/award-multi-lesson.test.js +0 -0
- package/test/awards/award-observer-integration.test.js +0 -0
- package/test/awards/award-query-messages.test.js +0 -0
- package/test/awards/award-user-collection.test.js +0 -0
- package/test/awards/duplicate-prevention.test.js +0 -0
- package/test/awards/helpers/completion-mock.js +0 -0
- package/test/awards/helpers/index.js +0 -0
- package/test/awards/helpers/mock-setup.js +0 -0
- package/test/awards/helpers/progress-emitter.js +0 -0
- package/test/awards/message-generator.test.js +0 -0
- package/test/content.test.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/dataContext.test.js +0 -0
- package/test/forum.test.js +0 -0
- package/test/imageSRCBuilder.test.js +0 -0
- package/test/imageSRCVerify.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/learningPaths.test.js +0 -0
- package/test/lib/__snapshots__/filter.test.ts.snap +0 -0
- package/test/lib/filter.test.ts +0 -0
- package/test/lib/lastUpdated.test.js +0 -0
- package/test/lib/query.test.ts +0 -0
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/mockData/award-definitions.js +0 -0
- package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
- package/test/mockData/mockData_progress_content.json +0 -0
- package/test/mockData/mockData_sanity_progress_content.json +0 -0
- package/test/mockData/mockData_user_practices.json +0 -0
- package/test/notifications.test.js +0 -0
- package/test/progressRows.test.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/test/streakMessage.test.js +0 -0
- package/test/sync/adapter.ts +0 -0
- package/test/sync/initialize-sync-manager.js +0 -0
- package/test/sync/models/award-database-integration.test.js +0 -0
- package/test/user/permissions.test.js +0 -0
- package/test/userActivity.test.js +0 -0
- package/tools/generate-index.cjs +0 -0
- package/.claude/settings.local.json +0 -22
package/.coderabbit.yaml
CHANGED
|
File without changes
|
package/.editorconfig
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.prettierignore
CHANGED
|
File without changes
|
package/.prettierrc
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.150.0](https://github.com/railroadmedia/musora-content-services/compare/v2.149.0...v2.150.0) (2026-04-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* throw specific error after abort; protect getLastFetchToken ([#905](https://github.com/railroadmedia/musora-content-services/issues/905)) ([7c084e4](https://github.com/railroadmedia/musora-content-services/commit/7c084e4b351e26f8464f568d658e855f84e31951))
|
|
11
|
+
|
|
12
|
+
## [2.149.0](https://github.com/railroadmedia/musora-content-services/compare/v2.148.0...v2.149.0) (2026-04-07)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* remove countdown logic for GC in progress card ([#897](https://github.com/railroadmedia/musora-content-services/issues/897)) ([254bc2a](https://github.com/railroadmedia/musora-content-services/commit/254bc2a0a695f68e449a49a71197be01654ba9aa))
|
|
18
|
+
|
|
5
19
|
## [2.148.0](https://github.com/railroadmedia/musora-content-services/compare/v2.145.6...v2.148.0) (2026-04-03)
|
|
6
20
|
|
|
7
21
|
|
package/CLAUDE.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.cjs
CHANGED
|
File without changes
|
package/jest.config.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
package/src/contentMetaData.js
CHANGED
|
File without changes
|
package/src/filterBuilder.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/lib/ads/monoid.ts
CHANGED
|
File without changes
|
package/src/lib/ads/semigroup.ts
CHANGED
|
File without changes
|
package/src/lib/brands.ts
CHANGED
|
File without changes
|
package/src/lib/lastUpdated.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/lib/sanity/filter.ts
CHANGED
|
File without changes
|
package/src/lib/sanity/query.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
showsLessonTypes,
|
|
13
13
|
songs,
|
|
14
14
|
} from '../../../contentTypeConfig.js'
|
|
15
|
-
import { getTimeRemainingUntilLocal } from '../../dateUtils.js'
|
|
16
15
|
import { PARENT_ID_TOP_LEVEL } from '../../sync/models/ContentProgress'
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -58,7 +57,7 @@ function generateContentPromises(contents) {
|
|
|
58
57
|
const promises = []
|
|
59
58
|
if (!contents) return promises
|
|
60
59
|
const existingShows = new Set()
|
|
61
|
-
|
|
60
|
+
const allRecentTypeSet = new Set(Object.values(recentTypes.homeRow))
|
|
62
61
|
allRecentTypeSet.delete('learning-path-v2') // we do this to remove from homepage, until we allow a-la-carte learning paths
|
|
63
62
|
contents.forEach((content) => {
|
|
64
63
|
const type = content.type
|
|
@@ -80,33 +79,12 @@ function generateContentPromises(contents) {
|
|
|
80
79
|
export async function processContentItem(content) {
|
|
81
80
|
const contentType = getFormattedType(content.type, content.brand)
|
|
82
81
|
const isLive = content.isLive ?? false
|
|
83
|
-
|
|
82
|
+
const ctaText = getDefaultCTATextForContent(content, contentType)
|
|
84
83
|
|
|
85
84
|
const { completedChildren, allChildren } = await getCompletedChildren(content, contentType)
|
|
86
85
|
content.completed_children = completedChildren
|
|
87
86
|
content.all_children = allChildren
|
|
88
87
|
|
|
89
|
-
if (content.type === 'guided-course') {
|
|
90
|
-
const nextLessonPublishedOn = content.children.find(
|
|
91
|
-
(child) => child.id === content.navigateTo.id
|
|
92
|
-
)?.published_on
|
|
93
|
-
let isLocked = new Date(nextLessonPublishedOn) > new Date()
|
|
94
|
-
if (isLocked) {
|
|
95
|
-
content.is_locked = true
|
|
96
|
-
const timeRemaining = getTimeRemainingUntilLocal(nextLessonPublishedOn, {
|
|
97
|
-
withTotalSeconds: true,
|
|
98
|
-
})
|
|
99
|
-
content.time_remaining_seconds = timeRemaining.totalSeconds
|
|
100
|
-
ctaText = 'Next lesson in ' + timeRemaining.formatted
|
|
101
|
-
} else if (
|
|
102
|
-
!content.progressStatus ||
|
|
103
|
-
content.progressStatus === 'not-started' ||
|
|
104
|
-
content.progressPercentage === 0
|
|
105
|
-
) {
|
|
106
|
-
ctaText = 'Start Course'
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
88
|
return {
|
|
111
89
|
id: content.id,
|
|
112
90
|
progressType: 'content',
|
|
@@ -125,16 +103,10 @@ export async function processContentItem(content) {
|
|
|
125
103
|
badge_template: content.badge_template ?? null,
|
|
126
104
|
badge_template_rear: content.badge_template_rear ?? null,
|
|
127
105
|
isLocked: content.is_locked ?? false,
|
|
128
|
-
subtitle:
|
|
129
|
-
collectionLessonTypes.includes(content.type) || content.lesson_count > 1
|
|
130
|
-
? `${content.completed_children ?? 0} of ${content.all_children ?? content.lesson_count ?? content.child_count} Lessons Complete`
|
|
131
|
-
: (contentType === 'lesson' || contentType === 'show') && isLive === false
|
|
132
|
-
? `${content.progressPercentage}% Complete`
|
|
133
|
-
: `${content.difficulty_string} • ${content.artist_name}`,
|
|
106
|
+
subtitle: getSubtitle(content, contentType, isLive),
|
|
134
107
|
},
|
|
135
108
|
cta: {
|
|
136
109
|
text: ctaText,
|
|
137
|
-
timeRemainingToUnlockSeconds: content.time_remaining_seconds ?? null,
|
|
138
110
|
action: {
|
|
139
111
|
type: content.type,
|
|
140
112
|
brand: content.brand,
|
|
@@ -147,21 +119,37 @@ export async function processContentItem(content) {
|
|
|
147
119
|
}
|
|
148
120
|
}
|
|
149
121
|
|
|
122
|
+
function getSubtitle(content, contentType, isLive) {
|
|
123
|
+
if (collectionLessonTypes.includes(content.type) || content.lesson_count > 1) {
|
|
124
|
+
return `${content.completed_children ?? 0} of ${content.all_children ?? content.lesson_count ?? content.child_count} Lessons Complete`
|
|
125
|
+
}
|
|
126
|
+
if ((contentType === 'lesson' || contentType === 'show') && !isLive) {
|
|
127
|
+
return `${content.progressPercentage}% Complete`
|
|
128
|
+
}
|
|
129
|
+
return `${content.difficulty_string} • ${content.artist_name}`
|
|
130
|
+
}
|
|
131
|
+
|
|
150
132
|
function getDefaultCTATextForContent(content, contentType) {
|
|
151
|
-
|
|
133
|
+
const notStarted =
|
|
134
|
+
!content.progressStatus ||
|
|
135
|
+
content.progressStatus === 'not-started' ||
|
|
136
|
+
content.progressPercentage === 0
|
|
137
|
+
if (content.type === 'guided-course' && notStarted) return 'Start Course'
|
|
138
|
+
|
|
152
139
|
if (content.progressStatus === 'completed') {
|
|
153
140
|
if (
|
|
154
141
|
contentType === songs[content.brand] ||
|
|
155
142
|
contentType === 'play along' ||
|
|
156
143
|
contentType === 'jam track'
|
|
157
144
|
)
|
|
158
|
-
|
|
159
|
-
if (contentType === 'lesson' || contentType === 'show')
|
|
145
|
+
return 'Replay Song'
|
|
146
|
+
if (contentType === 'lesson' || contentType === 'show') return 'Revisit Lesson'
|
|
160
147
|
if (contentType === 'song tutorial' || collectionLessonTypes.includes(content.type))
|
|
161
|
-
|
|
162
|
-
if (contentType === 'course-collection')
|
|
148
|
+
return 'Revisit Lessons'
|
|
149
|
+
if (contentType === 'course-collection') return 'View Lessons'
|
|
163
150
|
}
|
|
164
|
-
|
|
151
|
+
|
|
152
|
+
return 'Continue'
|
|
165
153
|
}
|
|
166
154
|
|
|
167
155
|
async function getCompletedChildren(content, contentType) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/state.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -72,3 +72,11 @@ export class SyncValidationError extends SyncError {
|
|
|
72
72
|
Object.setPrototypeOf(this, new.target.prototype)
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
export class SyncAbortError extends SyncError {
|
|
77
|
+
constructor(message: string = 'Sync operation was aborted', details?: ErrorDetails) {
|
|
78
|
+
super(message, details)
|
|
79
|
+
this.name = 'SyncAbortError'
|
|
80
|
+
Object.setPrototypeOf(this, new.target.prototype)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SyncAbortError } from './errors'
|
|
2
|
+
|
|
1
3
|
export default class SyncRunScope {
|
|
2
4
|
private abortController: AbortController
|
|
3
5
|
|
|
@@ -9,14 +11,14 @@ export default class SyncRunScope {
|
|
|
9
11
|
return this.abortController.signal
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
abort(): void {
|
|
13
|
-
this.abortController.abort()
|
|
14
|
+
abort(reason?: string): void {
|
|
15
|
+
this.abortController.abort(reason)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
abortable<T>(fn: () => Promise<T>): Promise<T> {
|
|
17
19
|
return new Promise((resolve, reject) => {
|
|
18
20
|
if (this.signal.aborted) {
|
|
19
|
-
reject(this.signal.reason)
|
|
21
|
+
reject(new SyncAbortError('Operation aborted', { reason: this.signal.reason }))
|
|
20
22
|
return
|
|
21
23
|
}
|
|
22
24
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -172,7 +172,9 @@ export default class SyncStore<TModel extends BaseModel = BaseModel> {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
async getLastFetchToken() {
|
|
175
|
-
return
|
|
175
|
+
return await this.runScope.abortable(async () => {
|
|
176
|
+
return (await this.db.localStorage.get<SyncToken | null>(this.lastFetchTokenKey)) ?? null
|
|
177
|
+
})
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
async pullRecords(span?: Span) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/HttpClient.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/content.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/dataContext.test.js
CHANGED
|
File without changes
|
package/test/forum.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/initializeTests.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/lib/filter.test.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/test/lib/query.test.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/sync/adapter.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tools/generate-index.cjs
CHANGED
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(tree:*)",
|
|
5
|
-
"Bash(find:*)",
|
|
6
|
-
"Bash(docker exec:*)",
|
|
7
|
-
"Bash(node:*)",
|
|
8
|
-
"Bash(npm run build-index:*)",
|
|
9
|
-
"Bash(npm run link_mcs:*)",
|
|
10
|
-
"Bash(./link_mcs.sh:*)",
|
|
11
|
-
"Bash(curl:*)",
|
|
12
|
-
"Bash(php artisan:*)",
|
|
13
|
-
"Bash(git checkout:*)",
|
|
14
|
-
"Bash(source .env)",
|
|
15
|
-
"Bash(echo:*)",
|
|
16
|
-
"Bash(grep:*)",
|
|
17
|
-
"Bash(gh api repos/railroadmedia/musora-platform-backend/commits/1f9878a5e681bf1e2233c0d59a618d477b118c49 --jq '.commit.message' 2>/dev/null || echo \"no access\")",
|
|
18
|
-
"WebFetch(domain:github.com)",
|
|
19
|
-
"Read(//app/**)"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|