musora-content-services 2.124.1 → 2.125.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.
Files changed (209) hide show
  1. package/.claude/settings.local.json +3 -4
  2. package/.coderabbit.yaml +0 -0
  3. package/.editorconfig +0 -0
  4. package/.github/pull_request_template.md +0 -0
  5. package/.github/workflows/conventional-commits.yaml +0 -0
  6. package/.github/workflows/docs.js.yml +0 -0
  7. package/.github/workflows/node.js.yml +0 -0
  8. package/.prettierignore +0 -0
  9. package/.prettierrc +0 -0
  10. package/CHANGELOG.md +20 -0
  11. package/README.md +0 -0
  12. package/TECHNICAL_DEBT.md +482 -0
  13. package/babel.config.cjs +0 -0
  14. package/jest.config.js +0 -0
  15. package/jsdoc.json +0 -0
  16. package/package.json +1 -1
  17. package/src/constants/award-assets.js +0 -0
  18. package/src/constants/membership-permissions.ts +0 -0
  19. package/src/contentTypeConfig.js +1 -8
  20. package/src/filterBuilder.js +0 -0
  21. package/src/infrastructure/http/HttpClient.ts +0 -0
  22. package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
  23. package/src/infrastructure/http/index.ts +0 -0
  24. package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
  25. package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
  26. package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
  27. package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
  28. package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
  29. package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
  30. package/src/lib/ads/monoid.ts +0 -0
  31. package/src/lib/ads/semigroup.ts +0 -0
  32. package/src/lib/brands.ts +0 -0
  33. package/src/lib/lastUpdated.js +0 -0
  34. package/src/lib/sanity/filter.ts +0 -0
  35. package/src/lib/sanity/query.ts +0 -0
  36. package/src/services/api/types.js +0 -0
  37. package/src/services/api/types.ts +0 -0
  38. package/src/services/awards/award-callbacks.js +0 -0
  39. package/src/services/awards/internal/.indexignore +0 -0
  40. package/src/services/awards/internal/award-definitions.js +0 -0
  41. package/src/services/awards/internal/award-events.js +0 -0
  42. package/src/services/awards/internal/award-manager.js +0 -0
  43. package/src/services/awards/internal/certificate-builder.js +0 -0
  44. package/src/services/awards/internal/completion-data-generator.js +0 -0
  45. package/src/services/awards/internal/content-progress-observer.js +0 -0
  46. package/src/services/awards/internal/image-utils.js +0 -0
  47. package/src/services/awards/internal/message-generator.js +0 -0
  48. package/src/services/awards/internal/types.js +0 -0
  49. package/src/services/awards/types.d.ts +0 -0
  50. package/src/services/awards/types.js +0 -0
  51. package/src/services/config.js +0 -0
  52. package/src/services/content/artist.ts +0 -0
  53. package/src/services/content/content.ts +0 -0
  54. package/src/services/content/genre.ts +0 -0
  55. package/src/services/content/instructor.ts +0 -0
  56. package/src/services/content-org/content-org.js +0 -0
  57. package/src/services/content-org/guided-courses.ts +0 -0
  58. package/src/services/content-org/playlists-types.js +0 -0
  59. package/src/services/content-org/playlists.js +0 -0
  60. package/src/services/contentAggregator.js +0 -0
  61. package/src/services/contentLikes.js +0 -0
  62. package/src/services/dataContext.js +0 -0
  63. package/src/services/dateUtils.js +0 -0
  64. package/src/services/eventsAPI.js +0 -0
  65. package/src/services/forums/categories.ts +0 -0
  66. package/src/services/forums/forums.ts +0 -0
  67. package/src/services/forums/posts.ts +1 -16
  68. package/src/services/forums/threads.ts +0 -0
  69. package/src/services/forums/types.ts +0 -0
  70. package/src/services/gamification/awards.ts +0 -0
  71. package/src/services/gamification/gamification.js +0 -0
  72. package/src/services/imageSRCBuilder.js +0 -0
  73. package/src/services/imageSRCVerify.js +0 -0
  74. package/src/services/liveTesting.ts +0 -0
  75. package/src/services/permissions/PermissionsAdapterFactory.ts +0 -0
  76. package/src/services/permissions/PermissionsV1Adapter.ts +0 -0
  77. package/src/services/permissions/PermissionsV2Adapter.ts +0 -0
  78. package/src/services/permissions/README.md +0 -0
  79. package/src/services/permissions/index.ts +0 -0
  80. package/src/services/progress-events.js +0 -0
  81. package/src/services/progress-row/rows/.indexignore +0 -0
  82. package/src/services/progress-row/rows/method-card.js +0 -0
  83. package/src/services/railcontent.js +0 -0
  84. package/src/services/reporting/README.md +0 -0
  85. package/src/services/reporting/reporting.ts +1 -5
  86. package/src/services/reporting/types.ts +0 -0
  87. package/src/services/sanity.js +6 -7
  88. package/src/services/sentry/.indexignore +0 -0
  89. package/src/services/sentry/index.ts +0 -0
  90. package/src/services/sync/.indexignore +0 -0
  91. package/src/services/sync/adapters/factory.ts +0 -0
  92. package/src/services/sync/adapters/lokijs.ts +0 -0
  93. package/src/services/sync/adapters/sqlite.ts +0 -0
  94. package/src/services/sync/context/index.ts +0 -0
  95. package/src/services/sync/context/providers/base.ts +0 -0
  96. package/src/services/sync/context/providers/connectivity.ts +0 -0
  97. package/src/services/sync/context/providers/durability.ts +0 -0
  98. package/src/services/sync/context/providers/index.ts +0 -0
  99. package/src/services/sync/context/providers/session.ts +0 -0
  100. package/src/services/sync/context/providers/tabs.ts +0 -0
  101. package/src/services/sync/context/providers/visibility.ts +0 -0
  102. package/src/services/sync/database/factory.ts +0 -0
  103. package/src/services/sync/effects/index.ts +0 -0
  104. package/src/services/sync/effects/logout-warning.ts +0 -0
  105. package/src/services/sync/errors/boundary.ts +0 -0
  106. package/src/services/sync/errors/index.ts +0 -0
  107. package/src/services/sync/errors/validators.ts +0 -0
  108. package/src/services/sync/fetch.ts +0 -0
  109. package/src/services/sync/index.ts +0 -0
  110. package/src/services/sync/manager.ts +0 -0
  111. package/src/services/sync/models/Base.ts +0 -0
  112. package/src/services/sync/models/ContentLike.ts +0 -0
  113. package/src/services/sync/models/ContentProgress.ts +0 -0
  114. package/src/services/sync/models/Practice.ts +0 -0
  115. package/src/services/sync/models/PracticeDayNote.ts +0 -0
  116. package/src/services/sync/models/UserAwardProgress.ts +0 -0
  117. package/src/services/sync/models/index.ts +0 -0
  118. package/src/services/sync/repositories/base.ts +0 -0
  119. package/src/services/sync/repositories/content-likes.ts +0 -0
  120. package/src/services/sync/repositories/index.ts +0 -0
  121. package/src/services/sync/repositories/practice-day-notes.ts +0 -0
  122. package/src/services/sync/repositories/practices.ts +0 -0
  123. package/src/services/sync/repositories/user-award-progress.ts +0 -0
  124. package/src/services/sync/repository-proxy.ts +0 -0
  125. package/src/services/sync/retry.ts +0 -0
  126. package/src/services/sync/run-scope.ts +0 -0
  127. package/src/services/sync/schema/index.ts +0 -0
  128. package/src/services/sync/serializers/index.ts +0 -0
  129. package/src/services/sync/serializers/model.ts +0 -0
  130. package/src/services/sync/serializers/raw.ts +0 -0
  131. package/src/services/sync/store/push-coalescer.ts +0 -0
  132. package/src/services/sync/store-configs.ts +0 -0
  133. package/src/services/sync/strategies/base.ts +0 -0
  134. package/src/services/sync/strategies/index.ts +0 -0
  135. package/src/services/sync/strategies/initial.ts +0 -0
  136. package/src/services/sync/strategies/polling.ts +0 -0
  137. package/src/services/sync/telemetry/flood-prevention.ts +0 -0
  138. package/src/services/sync/telemetry/sampling.ts +0 -0
  139. package/src/services/sync/utils/event-emitter.ts +0 -0
  140. package/src/services/sync/utils/index.ts +0 -0
  141. package/src/services/sync/utils/throttle.ts +0 -0
  142. package/src/services/sync/utils/timers.ts +0 -0
  143. package/src/services/types.js +0 -0
  144. package/src/services/urlBuilder.ts +3 -10
  145. package/src/services/user/account.ts +0 -0
  146. package/src/services/user/chat.js +0 -0
  147. package/src/services/user/interests.js +0 -0
  148. package/src/services/user/management.js +0 -0
  149. package/src/services/user/memberships.ts +0 -0
  150. package/src/services/user/notifications.js +0 -0
  151. package/src/services/user/onboarding.ts +0 -0
  152. package/src/services/user/payments.ts +0 -0
  153. package/src/services/user/permissions.js +0 -0
  154. package/src/services/user/profile.js +0 -0
  155. package/src/services/user/streakCalculator.ts +0 -0
  156. package/src/services/user/types.d.ts +0 -0
  157. package/src/services/user/types.js +0 -0
  158. package/src/services/user/user-management-system.js +0 -0
  159. package/test/HttpClient.test.js +0 -0
  160. package/test/awards/award-alacarte-observer.test.js +0 -0
  161. package/test/awards/award-auto-refresh.test.js +0 -0
  162. package/test/awards/award-calculations.test.js +0 -0
  163. package/test/awards/award-certificate-display.test.js +0 -0
  164. package/test/awards/award-collection-edge-cases.test.js +0 -0
  165. package/test/awards/award-collection-filtering.test.js +0 -0
  166. package/test/awards/award-completion-flow.test.js +0 -0
  167. package/test/awards/award-exclusion-handling.test.js +0 -0
  168. package/test/awards/award-multi-lesson.test.js +0 -0
  169. package/test/awards/award-observer-integration.test.js +0 -0
  170. package/test/awards/award-query-messages.test.js +0 -0
  171. package/test/awards/award-user-collection.test.js +0 -0
  172. package/test/awards/duplicate-prevention.test.js +0 -0
  173. package/test/awards/helpers/completion-mock.js +0 -0
  174. package/test/awards/helpers/index.js +0 -0
  175. package/test/awards/helpers/mock-setup.js +0 -0
  176. package/test/awards/helpers/progress-emitter.js +0 -0
  177. package/test/awards/message-generator.test.js +0 -0
  178. package/test/content.test.js +0 -0
  179. package/test/contentLikes.test.js +0 -0
  180. package/test/contentProgress.test.js +0 -0
  181. package/test/dataContext.test.js +0 -0
  182. package/test/forum.test.js +0 -0
  183. package/test/imageSRCBuilder.test.js +0 -0
  184. package/test/imageSRCVerify.test.js +0 -0
  185. package/test/initializeTests.js +0 -0
  186. package/test/learningPaths.test.js +0 -0
  187. package/test/lib/__snapshots__/filter.test.ts.snap +0 -0
  188. package/test/lib/filter.test.ts +0 -0
  189. package/test/lib/lastUpdated.test.js +0 -0
  190. package/test/lib/query.test.ts +0 -0
  191. package/test/live/contentProgressLive.test.js +0 -0
  192. package/test/live/railcontentLive.test.js +0 -0
  193. package/test/localStorageMock.js +0 -0
  194. package/test/log.js +0 -0
  195. package/test/mockData/award-definitions.js +0 -0
  196. package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
  197. package/test/mockData/mockData_progress_content.json +0 -0
  198. package/test/mockData/mockData_sanity_progress_content.json +0 -0
  199. package/test/mockData/mockData_user_practices.json +0 -0
  200. package/test/notifications.test.js +0 -0
  201. package/test/progressRows.test.js +0 -0
  202. package/test/sanityQueryService.test.js +0 -0
  203. package/test/streakMessage.test.js +0 -0
  204. package/test/sync/adapter.ts +0 -0
  205. package/test/sync/models/award-database-integration.test.js +0 -0
  206. package/test/user/permissions.test.js +0 -0
  207. package/test/userActivity.test.js +0 -0
  208. package/tools/generate-index.cjs +0 -0
  209. package/url, +0 -0
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(rg:*)",
5
- "Bash(npm run lint:*)"
6
- ],
7
- "deny": []
4
+ "Bash(grep:*)",
5
+ "Bash(find:*)"
6
+ ]
8
7
  }
9
8
  }
package/.coderabbit.yaml CHANGED
File without changes
package/.editorconfig CHANGED
File without changes
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,26 @@
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.125.0](https://github.com/railroadmedia/musora-content-services/compare/v2.122.7...v2.125.0) (2026-01-29)
6
+
7
+
8
+ ### Features
9
+
10
+ * **BEH-1505:** new award templates ([#740](https://github.com/railroadmedia/musora-content-services/issues/740)) ([e11f5f0](https://github.com/railroadmedia/musora-content-services/commit/e11f5f0db218132409b1d228a4c0a20500f73922))
11
+ * better user impersonation ([#731](https://github.com/railroadmedia/musora-content-services/issues/731)) ([768022d](https://github.com/railroadmedia/musora-content-services/commit/768022df839b2c2e206d02985c82075b0d4de008))
12
+ * **T3PS-1537:** Playbass Recommendations V2 ([#744](https://github.com/railroadmedia/musora-content-services/issues/744)) ([b88ffbd](https://github.com/railroadmedia/musora-content-services/commit/b88ffbd85a9982371e108d9f23190a9217cf29d0))
13
+ * **TP-1080:** ignore resume time until past 10s window ([#749](https://github.com/railroadmedia/musora-content-services/issues/749)) ([c22f4c2](https://github.com/railroadmedia/musora-content-services/commit/c22f4c201ec60dbf9475eebbcee199dfea967bbf))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **auth:** import ([2686f30](https://github.com/railroadmedia/musora-content-services/commit/2686f3004bef54ab548ec87a2665ff918c385421))
19
+ * **auth:** use http client for auth functions ([#751](https://github.com/railroadmedia/musora-content-services/issues/751)) ([6958adc](https://github.com/railroadmedia/musora-content-services/commit/6958adc87689a7dd433a8c66ccaff60317e6e962))
20
+ * makes methodIntroComplete function send formatted date matching getDailySession ([#725](https://github.com/railroadmedia/musora-content-services/issues/725)) ([6ac47a0](https://github.com/railroadmedia/musora-content-services/commit/6ac47a04dfa2ea4a0d355409b4be8fa743af1b48))
21
+ * resets trickled/bubbled records that are set to 0% in progress ([#746](https://github.com/railroadmedia/musora-content-services/issues/746)) ([056949b](https://github.com/railroadmedia/musora-content-services/commit/056949bc65b61aceb39e14fd5a485ef283817108))
22
+ * **T3PS-1715:** lp lesson practices and activity mapping ([#732](https://github.com/railroadmedia/musora-content-services/issues/732)) ([922e455](https://github.com/railroadmedia/musora-content-services/commit/922e4558b720b17533b3923fd08939ef69afa4f2))
23
+ * use jump-to-post url for notifications/reporting system ([91ff74f](https://github.com/railroadmedia/musora-content-services/commit/91ff74f227c350589f9558a60a76575abb71b0e2))
24
+
5
25
  ### [2.124.1](https://github.com/railroadmedia/musora-content-services/compare/v2.124.0...v2.124.1) (2026-01-29)
6
26
 
7
27
 
package/README.md CHANGED
File without changes
@@ -0,0 +1,482 @@
1
+ # 📊 Technical Debt Report - musora-content-services
2
+
3
+ **Generated:** 2025-12-29
4
+ **Package Version:** 2.107.4
5
+ **Total Issues Found:** 31
6
+
7
+ ---
8
+
9
+ ## 🔴 Critical Priority (3 issues)
10
+
11
+ ### 1. Missing TypeScript Configuration
12
+ **Impact:** High - Type safety not enforced
13
+ **Files Affected:** All 75 `.ts` files
14
+ **Issue:** No `tsconfig.json` found, TypeScript compiler not configured
15
+
16
+ **Action Required:**
17
+ - Add `tsconfig.json` with proper settings
18
+ - Add `typescript` to devDependencies
19
+ - Configure IDE/editor support
20
+
21
+ ---
22
+
23
+ ### 2. Permissions V2 Filter Generation Not Implemented
24
+ **File:** `src/services/permissions/PermissionsV2Adapter.ts:78`
25
+ **Impact:** High - Core feature incomplete
26
+
27
+ ```typescript
28
+ /**
29
+ * TODO: Implement v2 filter generation
30
+ *
31
+ * V2 Logic:
32
+ * - When showMembershipRestrictedContent is true:
33
+ * * Show content restricted by Plus Membership
34
+ * * This supports the membership upgrade modal
35
+ * - When showOnlyOwnedContent is true:
36
+ * * Shows only purchased/owned content
37
+ */
38
+ ```
39
+
40
+ **Action Required:**
41
+ - Implement v2 GROQ filter generation
42
+ - Add tests for membership upgrade modal scenarios
43
+ - Document filter behavior
44
+
45
+ ---
46
+
47
+ ### 3. WatermelonDB Bug Workaround
48
+ **File:** `src/services/sync/store/index.ts:255`
49
+ **Issue:** Critical workaround for WatermelonDB prepareUpdate() bug
50
+
51
+ ```typescript
52
+ // Workaround for WatermelonDB bug: prepareUpdate() doesn't commit field changes
53
+ ```
54
+
55
+ **Action Required:**
56
+ - Monitor WatermelonDB releases for fix
57
+ - Create test to validate when workaround can be removed
58
+ - Document workaround in README
59
+
60
+ ---
61
+
62
+ ## 🟡 High Priority (8 issues)
63
+
64
+ ### 4. Content Progress - Missing Parent Hierarchy
65
+ **File:** `src/services/contentProgress.js:99`
66
+
67
+ ```javascript
68
+ //TODO add parent hierarchy upwards as well
69
+ // data structure is the same but instead of child{} we use parent{}
70
+ ```
71
+
72
+ **Impact:** Navigation logic incomplete for upward traversal
73
+
74
+ ---
75
+
76
+ ### 5. Pack Navigation Logic Incomplete
77
+ **File:** `src/services/contentProgress.js:173`
78
+
79
+ ```javascript
80
+ // TODO: packs have an extra situation where we need to jump to
81
+ // the next course if all lessons in the last engaged course are completed
82
+ ```
83
+
84
+ **Impact:** Poor UX - users stuck when completing pack courses
85
+
86
+ ---
87
+
88
+ ### 6. Progress Data Structure Limitation
89
+ **File:** `src/services/contentProgress.js:263`
90
+
91
+ ```javascript
92
+ // todo: warning: this doesnt work with having 2 items with same
93
+ // contentId but different collection, because of the response
94
+ // structure here with contentId as key
95
+ ```
96
+
97
+ **Impact:** Data collision bug for duplicate content IDs across collections
98
+ **Risk:** Data loss or incorrect progress tracking
99
+
100
+ ---
101
+
102
+ ### 7. Content Metadata Not in WatermelonDB
103
+ **File:** `src/services/contentProgress.js:378`
104
+
105
+ ```javascript
106
+ // TODO: eventually put content metadata into watermelon so we can
107
+ // always have brand info in progress records and avoid all this
108
+ ```
109
+
110
+ **Impact:** Performance - Additional API calls needed, null-ish brand handling complexity
111
+
112
+ ---
113
+
114
+ ### 8. Playlist Progress Tracking Migration Pending
115
+ **File:** `src/services/userActivity.js:1017`
116
+
117
+ ```javascript
118
+ // todo post v2: refactor this once we migrate playlist
119
+ // progress tracking to new system
120
+ ```
121
+
122
+ **Impact:** Technical debt blocking v2 completion
123
+
124
+ ---
125
+
126
+ ### 9. Deprecated Method Card
127
+ **File:** `src/services/userActivity.js:1369`
128
+
129
+ ```javascript
130
+ //todo remove method card
131
+ ```
132
+
133
+ **Impact:** Code cleanup needed
134
+
135
+ ---
136
+
137
+ ### 10. Tiered-Course Content Type Not Implemented
138
+ **File:** `src/contentTypeConfig.js:221`
139
+
140
+ ```javascript
141
+ 'tiered-course', // TODO: new content type
142
+ ```
143
+
144
+ **Impact:** New content type defined but not fully implemented
145
+ **Risk:** Runtime errors if content type is used
146
+
147
+ ---
148
+
149
+ ### 11. Show Types Require Clarification
150
+ **File:** `src/contentTypeConfig.js:230`
151
+
152
+ ```javascript
153
+ // TODO these require clearing the information with Chris,
154
+ // they weren't part of the old system, but are part of
155
+ // the migration document as SHOWS
156
+ ```
157
+
158
+ **Impact:** Unclear content type classification blocking migration
159
+
160
+ ---
161
+
162
+ ## 🟢 Medium Priority (5 issues)
163
+
164
+ ### 12-13. Content Aggregator Performance
165
+ **Files:**
166
+ - `src/services/contentAggregator.js:65`
167
+ - `src/services/contentAggregator.js:159`
168
+
169
+ ```javascript
170
+ // todo: merge addProgressData with addResumeTimeSeconds
171
+ // to one watermelon call
172
+ ```
173
+
174
+ **Impact:** Performance - Two database calls instead of one
175
+
176
+ ---
177
+
178
+ ### 14. Bulk Update Event Emitting Missing
179
+ **File:** `src/services/sync/repositories/content-progress.ts:198`
180
+
181
+ ```typescript
182
+ //todo add event emitting for bulk updates?
183
+ ```
184
+
185
+ **Impact:** UI updates may not reflect bulk changes
186
+
187
+ ---
188
+
189
+ ### 15. Backwards Compatibility Code (Temporary)
190
+ **Files:**
191
+ - `src/services/content.js:357`
192
+ - `src/services/content.js:380`
193
+
194
+ ```javascript
195
+ // TODO: Remove content after FE/MA updates the
196
+ // existing code to use items
197
+ ```
198
+
199
+ **Impact:** Technical debt - duplicate `content` and `items` fields
200
+ **Action:** Coordinate with FE/MA teams for migration
201
+
202
+ ---
203
+
204
+ ### 16. Progress Slicing Missing
205
+ **File:** `src/services/userActivity.js:1003`
206
+
207
+ ```javascript
208
+ // TODO slice progress to a reasonable number, say 100
209
+ ```
210
+
211
+ **Impact:** Performance - Unbounded array growth
212
+
213
+ ---
214
+
215
+ ## 🔵 Low Priority (6 issues)
216
+
217
+ ### 17. Deprecated Code - Maintained for Compatibility
218
+ **File:** `src/services/userActivity.js:1229`
219
+
220
+ ```javascript
221
+ // TODO depreciated, maintained to avoid breaking changes
222
+ ```
223
+
224
+ **Impact:** Low - Functioning but marked for removal
225
+
226
+ ---
227
+
228
+ ### 18. Sanity Import - Instructor Calendars
229
+ **File:** `src/services/sanity.js:1179`
230
+
231
+ ```javascript
232
+ // TODO import instructor calendars to Sanity
233
+ ```
234
+
235
+ **Impact:** Data migration pending
236
+
237
+ ---
238
+
239
+ ### 19. Legacy Methods Still in Use
240
+ **File:** `src/services/content.js:446-457`
241
+
242
+ ```javascript
243
+ /**
244
+ * Fetches legacy methods for a given brand by permission.
245
+ */
246
+ export async function getLegacyMethods(brand) {
247
+ ```
248
+
249
+ **Impact:** Legacy code path still active
250
+
251
+ ---
252
+
253
+ ### 20. RailcontentConfig Deprecated
254
+ **File:** `src/services/types.js:14`
255
+
256
+ ```javascript
257
+ /**
258
+ * @deprecated use `config.session` and `config.baseUrl` instead.
259
+ * Will be removed in future versions.
260
+ */
261
+ ```
262
+
263
+ **Status:** Documented deprecation, replacement path clear
264
+
265
+ ---
266
+
267
+ ### 21. Sync Manager Database Init Risk
268
+ **File:** `src/services/sync/manager.ts:63`
269
+
270
+ ```typescript
271
+ // todo - can cause undefined??
272
+ this.database = this.telemetry.trace({ name: 'db:init' },
273
+ () => inBoundary(initDatabase))
274
+ ```
275
+
276
+ **Impact:** Potential undefined database object
277
+
278
+ ---
279
+
280
+ ### 22. Store Construction Hack
281
+ **File:** `src/services/sync/store/index.ts:658`
282
+
283
+ ```typescript
284
+ // NOTE: constructing models in this way is a bit of a hack,
285
+ ```
286
+
287
+ **Impact:** Code quality - Non-standard model construction
288
+
289
+ ---
290
+
291
+ ## ⚠️ Security & Performance (5 issues)
292
+
293
+ ### 23. NPM Security Vulnerabilities
294
+ **Count:** 5 vulnerabilities (1 low, 4 moderate)
295
+
296
+ **Details:**
297
+ 1. **@babel/helpers** - RegExp complexity (CVE Score: 6.2)
298
+ - Range: <7.26.10
299
+ - Severity: Moderate
300
+ - Fix: `npm audit fix`
301
+
302
+ 2. **@babel/runtime** - RegExp complexity (CVE Score: 6.2)
303
+ - Range: <7.26.10
304
+ - Severity: Moderate
305
+ - Affects: @nozbe/watermelondb
306
+
307
+ 3. **@nozbe/watermelondb** - Via @babel/runtime
308
+ - Current: 0.28.1-0
309
+ - Fix requires major version downgrade to 0.25.5
310
+
311
+ 4. **brace-expansion** - ReDoS vulnerability
312
+ - Severity: Low
313
+
314
+ **Action Required:**
315
+ ```bash
316
+ npm audit fix # For non-breaking changes
317
+ # Evaluate WatermelonDB downgrade impact
318
+ ```
319
+
320
+ ---
321
+
322
+ ### 24. Console.log Statements
323
+ **Count:** 263 statements across 30 files
324
+
325
+ **Risk:** Potential sensitive data leakage in production
326
+
327
+ **Examples:**
328
+ - `src/services/imageSRCVerify.js:61,110` - WARNING messages
329
+ - Multiple debug logs throughout codebase
330
+
331
+ **Action Required:**
332
+ - Replace with Sentry logging
333
+ - Add logging levels (debug, info, warn, error)
334
+ - Remove console.logs from production builds
335
+
336
+ ---
337
+
338
+ ### 25. TypeScript 'any' Usage
339
+ **Count:** 60 occurrences across 23 files
340
+
341
+ **Impact:** Reduces type safety benefits
342
+
343
+ **Action Required:**
344
+ - Audit each usage
345
+ - Replace with proper types
346
+ - Enable `noImplicitAny` in tsconfig.json
347
+
348
+ ---
349
+
350
+ ### 26. Process.env Usage in Mobile Context
351
+ **Files:**
352
+ - `src/filterBuilder.js:38` (commented out)
353
+ - `src/services/imageSRCVerify.js:60,109`
354
+
355
+ ```javascript
356
+ if (process.env.NODE_ENV !== 'production') {
357
+ console.warn(`WARNING: ...`)
358
+ }
359
+ ```
360
+
361
+ **Risk:** `process.env` not available in React Native without configuration
362
+
363
+ **Current Impact:** Low - Only used for warnings
364
+
365
+ **Action Required:**
366
+ - Use react-native-config for mobile builds
367
+ - Document environment variable strategy
368
+
369
+ ---
370
+
371
+ ### 27. Critical Award Query Warning
372
+ **File:** `src/services/awards/award-query.js:42`
373
+
374
+ ```javascript
375
+ // CRITICAL: Pass collection context when inside a learning path!
376
+ ```
377
+
378
+ **Impact:** Data integrity - Awards may be calculated incorrectly without collection context
379
+
380
+ **Action Required:**
381
+ - Add runtime validation
382
+ - Throw error if collection missing in learning path context
383
+ - Add test coverage
384
+
385
+ ---
386
+
387
+ ## 📈 Code Quality Issues
388
+
389
+ ### 28. Large Monolithic Files
390
+
391
+ **sanity.js:** 2,109 lines
392
+ - Multiple responsibilities: queries, filters, metadata
393
+ - **Recommendation:** Split into:
394
+ - `sanity/queries.js`
395
+ - `sanity/filters.js`
396
+ - `sanity/metadata.js`
397
+
398
+ **userActivity.js:** 1,454 lines
399
+ - Diverse functionality: practices, progress, statistics
400
+ - **Recommendation:** Split by domain:
401
+ - `user/practices.js`
402
+ - `user/progress-rows.js`
403
+ - `user/statistics.js`
404
+
405
+ ---
406
+
407
+ ### 29. Mixed JS/TS Codebase
408
+ - 42 `.js` files
409
+ - 75 `.ts` files
410
+ - Extensive cross-imports
411
+
412
+ **Recommendation:** Gradual migration to TypeScript
413
+
414
+ ---
415
+
416
+ ### 30. Inconsistent Export Patterns
417
+ - Only 10 files use `excludeFromGeneratedIndex`
418
+ - Permissions directory manually excluded in generator script
419
+ - No clear guidelines documented
420
+
421
+ ---
422
+
423
+ ### 31. Test Coverage Unknown
424
+ - 33 test files exist
425
+ - Coverage reporting enabled
426
+ - No recent coverage report available
427
+
428
+ **Action Required:**
429
+ ```bash
430
+ npm test -- --coverage
431
+ ```
432
+
433
+ ---
434
+
435
+ ## 📋 Summary by Priority
436
+
437
+ | Priority | Count | Requires Action |
438
+ |----------|-------|-----------------|
439
+ | 🔴 Critical | 3 | Immediate |
440
+ | 🟡 High | 8 | Next Sprint |
441
+ | 🟢 Medium | 5 | Next Quarter |
442
+ | 🔵 Low | 6 | Backlog |
443
+ | ⚠️ Security | 5 | Review & Plan |
444
+ | **TOTAL** | **31** | |
445
+
446
+ ---
447
+
448
+ ## 🎯 Recommended Action Plan
449
+
450
+ ### Sprint 1 (Immediate)
451
+ 1. Add `tsconfig.json` and configure TypeScript
452
+ 2. Run `npm audit fix` for security vulnerabilities
453
+ 3. Document critical award query collection requirement
454
+
455
+ ### Sprint 2-3 (Next 2 weeks)
456
+ 4. Implement Permissions V2 filter generation
457
+ 5. Fix content progress data structure collision bug (contentProgress.js:263)
458
+ 6. Complete pack navigation logic
459
+
460
+ ### Month 1
461
+ 7. Migrate playlist progress tracking to v2 system
462
+ 8. Refactor large files (sanity.js, userActivity.js)
463
+ 9. Replace console.log with Sentry logging
464
+
465
+ ### Quarter 1
466
+ 10. Complete content metadata WatermelonDB migration
467
+ 11. Remove backwards compatibility code (coordinate with FE/MA)
468
+ 12. Reduce TypeScript 'any' usage
469
+ 13. Achieve 80%+ test coverage
470
+
471
+ ---
472
+
473
+ ## 📝 Notes
474
+
475
+ This report was generated by analyzing:
476
+ - All TODO, FIXME, HACK, XXX comments
477
+ - Security vulnerabilities via npm audit
478
+ - Code quality metrics (file sizes, console.logs, TypeScript any usage)
479
+ - Deprecated code patterns
480
+ - Critical warnings in comments
481
+
482
+ **Last Updated:** 2025-12-29
package/babel.config.cjs CHANGED
File without changes
package/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.124.1",
3
+ "version": "2.125.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
File without changes
@@ -52,7 +52,7 @@ export const DEFAULT_FIELDS = [
52
52
  "'image': thumbnail.asset->url",
53
53
  "'thumbnail': thumbnail.asset->url",
54
54
  'difficulty',
55
- difficultyStringField(),
55
+ 'difficulty_string',
56
56
  'published_on',
57
57
  "'type': _type",
58
58
  "'length_in_seconds' : coalesce(length_in_seconds, soundslice[0].soundslice_length_in_second)",
@@ -760,10 +760,6 @@ export function artistOrInstructorNameAsArray(key = 'artists') {
760
760
  return `'${key}': select(artist->name != null => [artist->name], instructor[]->name)`
761
761
  }
762
762
 
763
- export function difficultyStringField(key = 'difficulty_string') {
764
- return `'${key}': select(difficulty_string == 'Novice' => 'Introductory', difficulty_string)`
765
- }
766
-
767
763
  export async function getFieldsForContentTypeWithFilteredChildren(
768
764
  contentType,
769
765
  asQueryString = true
@@ -829,9 +825,6 @@ const filterHandlers = {
829
825
  style: (value) => `"${value}" in genre[]->name`,
830
826
 
831
827
  difficulty: (value) => {
832
- if (value === 'Introductory') {
833
- return `(difficulty_string == "Novice" || difficulty_string == "Introductory")`
834
- }
835
828
  return `difficulty_string == "${value}"`
836
829
  },
837
830
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/lib/brands.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