document upstream merge requirements
This commit is contained in:
parent
6cceca90f9
commit
01f90265ec
1 changed files with 38 additions and 8 deletions
|
|
@ -358,14 +358,44 @@ seems to do a decent job.
|
||||||
- from `.config/example.yml` to `.config/ci.yml` and `chart/files/default.yml`
|
- from `.config/example.yml` to `.config/ci.yml` and `chart/files/default.yml`
|
||||||
- in `packages/backend/src/core/MfmService.ts`, from `toHtml` to `toMastoApiHtml`
|
- in `packages/backend/src/core/MfmService.ts`, from `toHtml` to `toMastoApiHtml`
|
||||||
- from `verifyLink` in `packages/backend/src/core/activitypub/models/ApPersonService.ts` to `verifyFieldLinks` in `packages/backend/src/misc/verify-field-link.ts` (if sensible)
|
- from `verifyLink` in `packages/backend/src/core/activitypub/models/ApPersonService.ts` to `verifyFieldLinks` in `packages/backend/src/misc/verify-field-link.ts` (if sensible)
|
||||||
|
- Check for changes that may require additional work:
|
||||||
- If there have been any changes to the federated user data (the
|
- If there have been any changes to the federated user data (the
|
||||||
`renderPerson` function in
|
`renderPerson` function in
|
||||||
`packages/backend/src/core/activitypub/ApRendererService.ts`), make
|
`packages/backend/src/core/activitypub/ApRendererService.ts`), make
|
||||||
sure that the set of fields in `userNeedsPublishing` and
|
sure that the set of fields in `userNeedsPublishing` and
|
||||||
`profileNeedsPublishing` in
|
`profileNeedsPublishing` in
|
||||||
`packages/backend/src/server/api/endpoints/i/update.ts` are still
|
`packages/backend/src/server/api/endpoints/i/update.ts` are still
|
||||||
correct.
|
correct.
|
||||||
|
- Check for any new instances of any memory cache class.
|
||||||
|
(`MemoryKVCache`, `MemorySingleCache`, `RedisKVCache`, `RedisSingleCache`, and `QuantumKVCache` are the current ones.)
|
||||||
|
These can usually be kept as-is, but all instances must be managed by `CacheManagementService`.
|
||||||
|
The conversion is easy:
|
||||||
|
1. Make sure that `CacheManagementService` is available.
|
||||||
|
In most cases, it can be injected through DI.
|
||||||
|
(it's in the `GlobalModule` which should be available everywhere.)
|
||||||
|
2. Find where the cache is constructed.
|
||||||
|
If it's a field initializer, then move it to the constructor (splitting declaration and initialization.)
|
||||||
|
3. Replace the `new Whatever()` statement with a call to `cacheManagementService.createWhatever()`.
|
||||||
|
Arguments can be kept as-is, but remove any references to `Redis`, `InternalEventService`, or `TimeService`.
|
||||||
|
(these are provided by `CacheManagementService` directly.)
|
||||||
|
4. Remove any calls to `dispose()` the cache.
|
||||||
|
Disposal is managed by `CacheManagementService`, so attempting to call any `dispose` or `onApplicationShutdown` method will produce a type error.
|
||||||
|
- Check for any new calls to native time functions:
|
||||||
|
- `Date.now()` - replace with `this.timeService.now`.
|
||||||
|
Inject `TimeService` via DI if it's not already available.
|
||||||
|
- `new Date()` - if there's a value passed in, then leave it.
|
||||||
|
But the no-args constructor should be replaced with `this.timeService.date`.
|
||||||
|
Inject `TimeService` via DI if it's not already available.
|
||||||
|
- `setTimeout` - migrate to `this.timeService.startTimer` or `this.timeService.startPromiseTimer`.
|
||||||
|
The parameters should be the same, but the return type is different.
|
||||||
|
You may need to replace some `NodeJS.Timeout` types with `this.timerHandle`.
|
||||||
|
Inject `TimeService` via DI if it's not already available.
|
||||||
|
- `setInterval` - migrate to `this.timeService.startTimer`.
|
||||||
|
Migration is mostly the same as `setTimeout`, but with one major difference:
|
||||||
|
You must add `{ repeated: true }` as the final option parameter.
|
||||||
|
If this is omitted, the code will compile but the interval will only fire once!
|
||||||
|
- Check for any new Chart subclasses, and make sure to inject `TimeService` and implement `getCurrentDate`.
|
||||||
|
- Check for any new Channel subclasses and add all missing DI parameters.
|
||||||
|
|
||||||
- Check the changes against our `develop` branch (`git diff develop`)
|
- Check the changes against our `develop` branch (`git diff develop`)
|
||||||
and against Misskey's `develop` branch (`git diff misskey/develop`).
|
and against Misskey's `develop` branch (`git diff misskey/develop`).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue