OF-1515: Migrate Private XML Storage to PEP#1051
Conversation
|
Instead of writing at least 22x duplicate code: It's a central piece of code which is not only used by PubSub, but also by MUC and other code, therefore it should be handled centrally by DataForms/FormField. I suggest having a method |
|
I'm not sure the models of XEP-0049 will support this. I need to review this in more detail, but loosely, I'm aware that |
8843730 to
5bf50a6
Compare
|
@dwd As far as I can see, that does not apply to this PR. We're having For what it's worth, I believe that the corresponding 'get' would not be of a child element of another child element, but for the 'outer' child element, thus returning all. |
Openfire supports XEP-0049, Private XML Storage. However, Openfire can also be used for XEP-0223: Persistent Storage of Private Data via PubSub. When a user previously used more than one client, where each client would use a different XEP to store private data, the private data that was stored by one client would not be shared with the other client. This is undesirable, as such data typically includes data that benefits every client used by the user. In this commit, all data that is stored in the Private XML Storage database table will be migrated to PEP. After a successful migration, the old database table is deleted. Openfire continues to offer XEP-0049: Private XML Storage functionality. However, whenever data is obtained or modified through methods defined in that XEP, the PEP data is modified.
5bf50a6 to
820cd40
Compare
|
Right, so here's my concern with this - and note, this might not be a concern in practise. XEP-0049 allows multiple elements within a particular namespace to be stored. So it'll allow multiple XEP-0048, for instance, says explicitly to use only one element. I have no idea if any server supports using more than one. If everything only uses one element, then this PR will probably work in this case. Second problem: this patch assumes that all existing XEP-0049 cases can be recast, verbatim, as XEP-0223 cases. This is true for XEP-0048, but there is no certainty that this would always be the case, despite the fact it is likely. Third problem: @iNPUTmice pointed out on the standards list that clients which attempt to synchronize XEP-0049 and XEP-0223 stored might get thoroughly confused if this is done automatically. I don't think any of these problems are definitely showstoppers, but I'm aware that as things stand, there is no way to undo this action if there does turn out to be problems. If we hit operational problems with this patch, what would we do? |
|
The implementation of XEP-0049 stores only one element (and disregards others). For example, in this example, only the 'dave' element would be stored, and not the 'guus' element. That's probably a bug (I particularly dislike the silent ignore), but given that I'm only finding out about this now, I don't think it affects to many people. I'd be fine by modifying the XEP-0049 implementation to explicitly return errors if more than one element is added. This should retain compatibility with XEP-0048. This should tackle your #1 and #2 concerns, I believe. My Google foo isn't strong enough to find the issue raised by Daniel. Could you kindly provide a pointer? |
Note that this PR is based on the code that is in a different PR: #1049