context_v1_pointsAutomation.AwardPoints assigns points twice

Hi, I have developed a custom points automation for assigning points to a reply author when someone likes the reply (Event: ForumReplyVote.AfterCreate).

It works well if a user clicks the vote up/down button, but when the thread author makes the reply as a "verified answer," the system automatically fires a "Vote" event and assigns the points twice.

In the logs, below statement being called only once, but i see two entries in pointtransaction table in the database.

context_v1_pointsAutomation.RevokePoints(userId, context_v2_automationTrigger.Arguments.ContentId, context_v2_automationTrigger.Arguments.ContentTypeId);

logs:

25 Oct 2021 12:57 PM2 TimesIP 10.208.190.46
Assign points to content author- Ended

25 Oct 2021 12:57 PM2 TimesIP 10.208.190.46
Assign Points

25 Oct 2021 12:57 PM2 TimesIP 10.208.190.46
awardedPoints:: false

ContentFragmentRenderingError
25 Oct 2021 12:57 PM2 TimesIP 10.208.190.46
Assign points to content author -started

Any help on this will be greatly appreciated.

Thank you!!

Parents
No Data
Reply
  • Former Member
    +1 Former Member in reply to cdns123

    Thank you for the additional info and repro steps. I'm able to reproduce this now, and have logged a bug. To workaround, you can edit the Forum - Thread widget ui.js file to make sequential calls in the voteReply function, instead of simultaneous.

    		voteReply: function (context, replyId) {
    			// up-vote the quality of the reply along with voting up the answer/verification
    			return $.telligent.evolution.post({
    				url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums/threads/replies/{ReplyId}/vote.json',
    				data: {
    					ReplyId: replyId,
    					VoteType: 'Quality',
    					Value: true
    				}
    			}).then(function(){ 
    			    $.telligent.evolution.post({
        				url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums/threads/replies/{ReplyId}/vote.json',
        				data: {
        					ReplyId: replyId
        				}
        			})
    			});
    		},

    [embed:1a3cced3-af51-49ce-89e2-91f65855cd2d:b1627e41-847b-4b38-beb7-76457c3c8e30:id=TE-17185]

Children
No Data