-
Notifications
You must be signed in to change notification settings - Fork 12
Readonly Records on create #40
Comments
Hey, that's a great question! We are currently looking at the possibility of being able to subscribe to something that doesn't exist, basically providing a subscription only request. This is done by some amendments we are making to the protocol that only does a subscribe without a create. I'm not sure what a temporary solution is without allowing creation but not allowing writes. I understand this is not ideal but we should hopefully have a fix in the near future! |
ok thanks, allowing the create and no write for users gets things going. Only downside is a user could create some records you do not want in the system but you should be able to minimize that through application code. I look forward to the new feature in the future. |
Also a feature where you could know when the record was last written would be handy in the scenario described above. For example when a client subscribes to a record and it is readonly for them, the active data provider will get notified. Then I only want to refresh the record if it is > then say 1 hour old. I can store the write date in the record but it sounds like something that could be part of deepstream. The last written could also be useful if you wanted to implement something like Time To Live, (TTL), on the records so they can expire like in a cache. |
This is implemented in V4 JS client using the readonlyFlag, which tells the client to only subscribe read and not create. This is a blanket feature, if you use it you would then need to explicitly mention the records you want to use write features on (prefixes).
In terms of TTL, that logic would need to exist in your providers or a custom cache layer. |
If I have user A that has read access to a record, (that does not exist yet, ie no create permission).
And I have a active data provider that listens for that record, then goes off and gets the real data and sets it into deepstream.
What should happen when user A calls the Record.get as the doco says it creates the record if it does not exist. eg I only want the active data provider to create the record.
The text was updated successfully, but these errors were encountered: