Skip to content

SF-3920 Fix event metrics not being recorded for BuildCompletedAsync - #4079

Open
pmachapman wants to merge 1 commit into
masterfrom
fix/SF-3920
Open

SF-3920 Fix event metrics not being recorded for BuildCompletedAsync#4079
pmachapman wants to merge 1 commit into
masterfrom
fix/SF-3920

Conversation

@pmachapman

@pmachapman pmachapman commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes a bug I noticed on live where the following error was being logged in the journal:

Error logging event metric for BuildCompletedAsync
System.FormatException: Cannot deserialize a 'BsonDocument' from BsonType 'Int32'.
   at MongoDB.Bson.Serialization.Serializers.BsonValueSerializerBase`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
   at MongoDB.Bson.BsonDocument.Parse(String json)
   at SIL.XForge.Services.EventMetricService.GetBsonValue(Object objectValue) in D:\Source\Repos\web-xforge\src\SIL.XForge\Services\EventMetricService.cs:line 175
   at SIL.XForge.Services.EventMetricService.SaveEventMetricAsync(String projectId, String userId, String eventType, EventScope scope, Dictionary`2 argumentsWithNames, Object result, Nullable`1 executionTime, Exception exception) in D:\Source\Repos\web-xforge\src\SIL.XForge\Services\EventMetricService.cs:line 108
   at SIL.XForge.EventMetrics.EventMetricLogger.<>c__DisplayClass7_0.<<Intercept>g__SaveEventMetricAsync|0>d.MoveNext() in D:\Source\Repos\web-xforge\src\SIL.XForge\EventMetrics\EventMetricLogger.cs:line 189

This error doesn't prevent builds from completing, but will prevent the recording of the BuildCompletedAsync event metric.


This change is Reviewable

@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label Aug 31, 2026
@pmachapman
pmachapman deployed to screenshot_diff August 31, 2026 03:17 — with GitHub Actions Active
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.26%. Comparing base (b906996) to head (c130697).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4079   +/-   ##
=======================================
  Coverage   81.25%   81.26%           
=======================================
  Files         670      670           
  Lines       43467    43473    +6     
  Branches     7132     7126    -6     
=======================================
+ Hits        35321    35328    +7     
+ Misses       6976     6960   -16     
- Partials     1170     1185   +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📸 Screenshot diff deployed! (1 change)

View the visual diff at: https://pr-4079--sf-screenshot-diffs.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

will require testing PR should not be merged until testers confirm testing is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant