Jump to content
Graham Quince

Datastore - Update

Recommended Posts

Hi everyone,

We're adding an improvement to the datastore FDP to prevent duplicate entries.  The Visitor Log, Link Log and Rewards widgets all have duplication checks written into them, so these will not be affected.  If you've used the datastore for your own widgets and have concerns about duplicate entries, feel free to get in touch with me.  I can take a look and if there's a question about it, i can arrange for a developer to help out.

I don't have an ETA for when this change will take place, but it's not in the immediate future.


Just an update, we're not making changes to the FDP after all.

Link to comment
Share on other sites

Hi Paul,

Currently if you were to pass identical information to the API using datastore/create, it is possible to have two entries in the database.  This has caused problems with some of our internal uses of the datastore, when retrieving information is one record is returned instead of both.  The proposed changes will prevent duplication.

The widgets I've created are all based on the Visitor Log includes a check before creating an entry:

                url: 'datastore/get',
                path: '/api/fdp/2/',
                type: 'GET',
                data: {
                    target_uuid: this.options.site_uuid,
                    alias: this.prefs.dataref.value,
                    user_uuid: FrogOS.getUser().uuid
            }).done(function(response) {
                var visit_data,
                    is_update = false;
                if (response.response.length) {
                    visit_data = JSON.parse(response.response[0].data);
                    is_update = response.response[0].uuid;
                } else {
                    visit_data = {
                        user_uuid: FrogOS.getUser().uuid,
                        visits: []
                this.logVisit(visit_data, is_update);


Link to comment
Share on other sites

Sorry @Graham Quince I’m still not sure what constitutes a duplicate?

Is it that you will not allow a record with the same user_uuid, target_uuid and alias? If so please don’t do this! Kids tend to get into trouble more than once! We are using one data store record per behaviour incident. Actually we use alias for the subject, but still, kids tend to get into trouble more than once per subject.

At least a year of work is in jeopardy here! This allowed us to finally break free of sims and build our own behaviour system without any constraints.

I can send you some example records for the developers to have a look?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...