Skip to content

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

Merged
Nateowami merged 1 commit into
masterfrom
fix/SF-3920
Sep 9, 2026
Merged

SF-3920 Fix event metrics not being recorded for BuildCompletedAsync#4079
Nateowami merged 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
@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 80.94%. Comparing base (1bf3173) to head (90aec91).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4079   +/-   ##
=======================================
  Coverage   80.94%   80.94%           
=======================================
  Files         664      664           
  Lines       42115    42121    +6     
  Branches     6936     6936           
=======================================
+ Hits        34088    34095    +7     
+ Misses       6880     6879    -1     
  Partials     1147     1147           

☔ 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! (2 changes)

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

@RaymondLuong3 RaymondLuong3 self-assigned this Sep 8, 2026

@RaymondLuong3 RaymondLuong3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RaymondLuong3 reviewed 5 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on pmachapman).

@RaymondLuong3 RaymondLuong3 added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Sep 8, 2026
@Nateowami Nateowami added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Sep 9, 2026
@Nateowami
Nateowami enabled auto-merge (squash) September 9, 2026 14:39
@Nateowami
Nateowami merged commit 17b3119 into master Sep 9, 2026
29 checks passed
@Nateowami
Nateowami deleted the fix/SF-3920 branch September 9, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing complete Testing of PR is complete and should no longer hold up merging of the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants