Skip to content
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

Deleting the collection of an open model creates an error condition #226

Open
mmacfadden opened this issue Jun 13, 2021 · 1 comment
Open
Labels
bug Something isn't working server Issues related to the server
Milestone

Comments

@mmacfadden
Copy link
Contributor

Versions

  • Convergence Version: 1.0.0-rc.8

Describe the Bug
When a collection is deleted all of its open models are deleted in the database. However, if a model in that collection is open, the RealTimeModelActor is not notified and does not know that it's underlying data has been deleted. This can lead to a number of hard to diagnose exceptions when the model is interacted with. for example if a new user tries to open the model it will fail with a persistence error saying Unable to get the valueIdPrefix for the model.

Step To Reproduce

  1. Create a realtime model in the test collection.
  2. Open the model in the admin console.
  3. In another browser tab, delete the test collection
  4. Try to edit the model.

Expected Behavior
RealTimeModels should be notified when their containing collection is deleted and be closed down. An appropriate cause should be sent to the user.

@mmacfadden mmacfadden added the bug Something isn't working label Jun 13, 2021
@mmacfadden
Copy link
Contributor Author

An example exception that can be produced if trying to open a model that is presently open by another session but deleted:

Unable to get the valueIdPrefix for the model
com.convergencelabs.convergence.server.backend.datastore.EntityNotFoundException: 
	at com.convergencelabs.convergence.server.backend.datastore.OrientDBUtil$.assertOneDoc(OrientDBUtil.scala:325) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.datastore.OrientDBUtil$.$anonfun$singleResultCommand$1(OrientDBUtil.scala:59) ~[classes/:?]
	at scala.util.Success.flatMap(Try.scala:258) ~[scala-library-2.13.5.jar:?]
	at com.convergencelabs.convergence.server.backend.datastore.OrientDBUtil$.singleResultCommand(OrientDBUtil.scala:59) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$getAndIncrementNextValuePrefix$1(ModelStore.scala:181) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.$anonfun$withDatabase$3(PooledDatabaseProvider.scala:58) ~[classes/:?]
	at com.convergencelabs.convergence.server.util.TryWithResource.tryWithResolvedResource(TryWithResource.scala:50) ~[classes/:?]
	at com.convergencelabs.convergence.server.util.TryWithResource.com$convergencelabs$convergence$server$util$TryWithResource$$tryWithResource(TryWithResource.scala:36) ~[classes/:?]
	at com.convergencelabs.convergence.server.util.TryWithResource$.apply(TryWithResource.scala:78) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.$anonfun$withDatabase$1(PooledDatabaseProvider.scala:56) ~[classes/:?]
	at scala.util.Success.flatMap(Try.scala:258) ~[scala-library-2.13.5.jar:?]
	at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.withDatabase(PooledDatabaseProvider.scala:55) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.datastore.AbstractDatabasePersistence.withDb(AbstractDatabasePersistence.scala:32) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.getAndIncrementNextValuePrefix(ModelStore.scala:178) ~[classes/:?]
	at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelManager.respondToClientOpenRequest(RealtimeModelManager.scala:476) [classes/:?]
	at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelManager.onOpenModelWhileInitialized(RealtimeModelManager.scala:466) [classes/:?]
	at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelManager.onOpenRealtimeModelRequest(RealtimeModelManager.scala:162) 

@mmacfadden mmacfadden added the server Issues related to the server label Jun 13, 2021
@mmacfadden mmacfadden changed the title Deleting the collection of an Open model creates an error condition Deleting the collection of an open model creates an error condition Jun 13, 2021
@mmacfadden mmacfadden added this to the 1.0.0-rc.11 milestone Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Issues related to the server
Projects
None yet
Development

No branches or pull requests

1 participant