docs/plans/4803-update-upload-history.md
updateUploadHistory throws an error when undos is emptyupdateUploadHistory in the media placeholder flow.findLastIndex can return -1, which makes editor.history.undos[index] undefined and batch.operations crash.docs/solutions/.updateUploadHistory is exported from @platejs/media/react but consumed by the docs/template placeholder component layer, so the right regression seam is the utility spec, not the demo component.updateUploadHistorypnpm lint:fixbun test src/react/placeholder/utils/history.spec.tspnpm installpnpm turbo build --filter=./packages/mediapnpm turbo typecheck --filter=./packages/mediapnpm lint:fixpnpm check