Automation: Main Next Integrate

This commit is contained in:
Sonali Deshpande 2022-07-25 15:36:57 -07:00 коммит произвёл GitHub
Родитель ac62ad4603 ec0e484d11
Коммит 23c55c777e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 38 добавлений и 3 удалений

Просмотреть файл

@ -414,7 +414,9 @@ export class LocalReferenceCollection {
for (const iterable of refs) {
for (const lref of iterable) {
assertLocalReferences(lref);
if (refTypeIncludesFlag(lref, ReferenceType.SlideOnRemove)) {
if (refTypeIncludesFlag(lref, ReferenceType.StayOnRemove)) {
continue;
} else if (refTypeIncludesFlag(lref, ReferenceType.SlideOnRemove)) {
lref.callbacks?.beforeSlide?.();
beforeRefs.unshift(lref);
lref.link(this.segment, 0, beforeRefs.next);
@ -442,7 +444,9 @@ export class LocalReferenceCollection {
for (const iterable of refs) {
for (const lref of iterable) {
assertLocalReferences(lref);
if (refTypeIncludesFlag(lref, ReferenceType.SlideOnRemove)) {
if (refTypeIncludesFlag(lref, ReferenceType.StayOnRemove)) {
continue;
} else if (refTypeIncludesFlag(lref, ReferenceType.SlideOnRemove)) {
lref.callbacks?.beforeSlide?.();
afterRefs.enqueue(lref);
lref.link(this.segment, lastOffset, afterRefs.prev);

Просмотреть файл

@ -140,6 +140,35 @@ describe("SharedString interval collections", () => {
]);
});
describe("remain consistent on double-delete", () => {
let collection: IntervalCollection<SequenceInterval>;
let collection2: IntervalCollection<SequenceInterval>;
beforeEach(() => {
sharedString.insertText(0, "01234");
collection = sharedString.getIntervalCollection("test");
collection2 = sharedString.getIntervalCollection("test");
containerRuntimeFactory.processAllMessages();
});
it("causing references to slide forward", () => {
sharedString2.removeRange(2, 3);
collection.add(2, 2, IntervalType.SlideOnRemove);
sharedString.removeRange(2, 4);
containerRuntimeFactory.processAllMessages();
assertIntervals(sharedString, collection, [{ start: 2, end: 2 }]);
assertIntervals(sharedString2, collection2, [{ start: 2, end: 2 }]);
});
it("causing references to slide backward", () => {
sharedString2.removeRange(2, 3);
collection.add(2, 2, IntervalType.SlideOnRemove);
sharedString.removeRange(2, 5);
containerRuntimeFactory.processAllMessages();
assertIntervals(sharedString, collection, [{ start: 1, end: 1 }]);
assertIntervals(sharedString2, collection2, [{ start: 1, end: 1 }]);
});
});
it("errors creating invalid intervals", () => {
const collection1 = sharedString.getIntervalCollection("test");
containerRuntimeFactory.processAllMessages();

Просмотреть файл

@ -85,6 +85,7 @@
"@fluidframework/view-interfaces": ">=2.0.0-internal.1.0.0 <2.0.0-internal.2.0.0",
"@fluidframework/web-code-loader": ">=2.0.0-internal.1.0.0 <2.0.0-internal.2.0.0",
"axios": "^0.26.0",
"buffer": "^6.0.3",
"express": "^4.16.3",
"nconf": "^0.11.4",
"sillyname": "^0.1.0",

Просмотреть файл

@ -33,7 +33,8 @@ module.exports = {
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback:{
"url": require.resolve("url")
"url": require.resolve("url"),
"buffer": require.resolve("buffer")
}
},
// Some of Fluid's dependencies depend on things like global and process.env.NODE_ENV being defined. This won't be set in Webpack 5 by default, so we are setting it with the define plugin.