mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[history-v1] fix missing linked file metadata when adding file (#32524)
* [overleaf-editor-core] rename stats field for file metadata * [history-v1] fix missing linked file metadata when adding file * [history-v1] address review feedback * [saas-e2e] remove extra login call GitOrigin-RevId: 178254993f9a9803b160ad8bb661f480144a3cf2
This commit is contained in:
@@ -129,9 +129,9 @@ class File {
|
|||||||
toStats() {
|
toStats() {
|
||||||
const stats = this.data.toStats()
|
const stats = this.data.toStats()
|
||||||
if (!_.isEmpty(this.metadata)) {
|
if (!_.isEmpty(this.metadata)) {
|
||||||
stats.nMeta = 1
|
stats.nMetadata = 1
|
||||||
// Note: Buffer does not exist in frontend. Use string length instead.
|
// Note: Buffer does not exist in frontend. Use string length instead.
|
||||||
stats.metaSize = JSON.stringify(this.metadata).length
|
stats.metadataSize = JSON.stringify(this.metadata).length
|
||||||
}
|
}
|
||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ const Blob = require('overleaf-editor-core').Blob
|
|||||||
|
|
||||||
const hexHashPattern = new RegExp(Blob.HEX_HASH_RX_STRING)
|
const hexHashPattern = new RegExp(Blob.HEX_HASH_RX_STRING)
|
||||||
|
|
||||||
const fileSchema = z.object({
|
const fileSchema = z
|
||||||
hash: z.string().optional(),
|
.object({
|
||||||
byteLength: z.number().int().nullable().optional(),
|
hash: z.string().optional(),
|
||||||
stringLength: z.number().int().nullable().optional(),
|
byteLength: z.number().int().nullable().optional(),
|
||||||
})
|
stringLength: z.number().int().nullable().optional(),
|
||||||
|
metadata: z.object({}).passthrough().optional(),
|
||||||
|
})
|
||||||
|
.passthrough()
|
||||||
|
|
||||||
const snapshotSchema = z.object({
|
const snapshotSchema = z.object({
|
||||||
files: z.record(z.string(), fileSchema),
|
files: z.record(z.string(), fileSchema),
|
||||||
|
|||||||
Reference in New Issue
Block a user