-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce batch sub-types #10967
Comments
Where
Where
I hope I didn't miss anything. For me, it looks like a mixed bag of everything. It feels that it hold together by a coincidence, because some uses and checks are separate groups of scenarios that do not intersect. From these uses and checks, only change buffer case seems to me like it is more general and would like to ignore some general kind of "transparent" batches. Other than that we have clear groups of uses and checks. Except of change buffer case, I now think that general I propose:
Old |
This, to make it clear ( |
Feature: Replaced `Batch#type` with a set of flags: `isUndoable`, `isLocal`, `isUndo`, `isTyping` which better represent the batch type. `Batch` constructor and `Model#enqueueChange()` now expect an object. Closes #10967. Fix (typing): Fixed editor crash when an unrecognized transformation was given in configuration (as a string). Other (typing): Typing feature will now create batches with `isTyping` set to `true`. Other (undo): Undo feature will now create batches with `isUndo` set to `true`. BREAKING CHANGE (engine): `Batch#type` has been deprecated. It will always return `'default'` value and reading it will log a warning in the console. Use `Batch#isUndoable`, `#isLocal`, `#isUndo` and `#isTyping` instead. BREAKING CHANGE (typing): `Input#isInput()` has been removed. Use `Batch#isTyping` instead. MINOR BREAKING CHANGE (engine): String value for `Batch` type and `Model#enqueueChange()` is now deprecated. Using string value will log a warning in the console. Use an object value instead. For more information, refer to the API documentation.
Recently, we discussed some problems connected with remote operations. In general, at the moment, there's no flag or easy way to check whether given batch contains operations created locally or coming from a remote client through real-time collaboration.
Related tickets are #9233, #10582. Solving autosave issue will also be helpful in revision history feature.
Proposed solution:
At the moment, we have
Batch#type
property. AFAIR, we have only one batch type, i.e.transparent
and it has very wide meaning. Because of that, we can't really use this information. For example, remote operations are only in transparent batch, but this is not the only usage for transparent batches. So, we can't use this information in determining how the algorithm should work if we want to target remote operations only.Instead we propose dropping
type
property in the favor of a set of more precise flags, e.g.:Batch#isLocal
(defaulttrue
),Batch#isTyping
(defaultfalse
, replacement forInput#isInput
),Batch#isTransparent
(defaultfalse
, not sure if needed),Batch#isUndo
(defaultfalse
, not sure if needed).Batch#isUndoable
(kind of opposite to today's'transparent'
batch type, as we most probably introduced transparent batches for undo reasons, this is just an idea).Those flags would be set the same way
type
is set at the moment:Using
'transparent'
as batch type in those calls would be deprecated.Questions for refinement:
isLocal = false
batch has local operations? This could happen if RTC operations triggered a post-fixer.transparent
batches? Where do we set them and where do we readBatch#type
?isTransparent
batch subtype? If not, what do to withmodel.enqueueChange( 'transparent', ... )
calls (we had an idea that they should be mapped to{ isTransparent: true }
. If there's noisTransparent
then we probably needisUndoable
and set it correctly.isLocal = false
meansisTransparent = true
. (orisUndoable = false
).My answers for now:
isLocal
,isTyping
,isTransparent
.isTransparent
generic subtype because we don't know how it is used in 3rd party code.isTransparent
subtype is the closest to what is available right now, so let's stick with it.isLocal
will be used only in one place and AFAICS this is the only thing that we would enforce.The text was updated successfully, but these errors were encountered: