refactor: 🗑️ deprecate DB_MAX_NOTE_TEXT_LENGTH

This commit is contained in:
ThatOneCalculator 2023-07-15 00:06:42 -07:00
parent e3b8c05e47
commit 9f38f8bbca
No known key found for this signature in database
GPG key ID: 8703CACD01000000
5 changed files with 5 additions and 6 deletions

View file

@ -121,7 +121,7 @@ redis:
# ┌─────────────────────┐ # ┌─────────────────────┐
#───┘ Other configuration └───────────────────────────────────── #───┘ Other configuration └─────────────────────────────────────
# Maximum length of a post (default 3000, max 8192) # Maximum length of a post (default 3000, max 250000000)
#maxNoteLength: 3000 #maxNoteLength: 3000
# Maximum length of an image caption (default 1500, max 8192) # Maximum length of an image caption (default 1500, max 8192)

View file

@ -1,8 +1,7 @@
import config from "@/config/index.js"; import config from "@/config/index.js";
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
export const MAX_NOTE_TEXT_LENGTH = export const MAX_NOTE_TEXT_LENGTH = config.maxNoteLength ?? 3000;
config.maxNoteLength != null ? config.maxNoteLength : 3000; // <- should we increase this?
export const MAX_CAPTION_TEXT_LENGTH = Math.min( export const MAX_CAPTION_TEXT_LENGTH = Math.min(
config.maxCaptionLength ?? 1500, config.maxCaptionLength ?? 1500,
DB_MAX_IMAGE_COMMENT_LENGTH, DB_MAX_IMAGE_COMMENT_LENGTH,

View file

@ -3,8 +3,9 @@
/** /**
* Maximum note text length that can be stored in DB. * Maximum note text length that can be stored in DB.
* Surrogate pairs count as one * Surrogate pairs count as one
* DEPRECARTED: use const/MAX_NOTE_TEXT_LENGTH instead
*/ */
export const DB_MAX_NOTE_TEXT_LENGTH = 8192; // export const DB_MAX_NOTE_TEXT_LENGTH = 8192;
/** /**
* Maximum image description length that can be stored in DB. * Maximum image description length that can be stored in DB.

View file

@ -1,6 +1,5 @@
import { Meta } from "@/models/entities/meta.js"; import { Meta } from "@/models/entities/meta.js";
import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js";
import { DB_MAX_NOTE_TEXT_LENGTH } from "@/misc/hard-limits.js";
import { db } from "@/db/postgre.js"; import { db } from "@/db/postgre.js";
import define from "../../define.js"; import define from "../../define.js";

View file

@ -12,7 +12,7 @@ namespace MisskeyEntity {
disableRegistration: boolean disableRegistration: boolean
disableLocalTimeline: boolean disableLocalTimeline: boolean
bannerUrl: string bannerUrl: string
maxNoteTextLength: 300 maxNoteTextLength: 3000
emojis: Array<Emoji> emojis: Array<Emoji>
} }
} }