Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Apex code snippets auto-truncated #758

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Sep 2, 2024

Fixed #756 by truncating the Apex code snippets that are saved in the LogEntry__c fields OriginSourceSnippet__c and ExceptionSourceSnippet__c

  • Previously, the code snippet was only limited by the number of lines of code - but for Apex classes & triggers that have very looooooooooooong code on some lines, the code snippet could cause the JSON value to exceed the corresponding field's max length
  • Now, the code snippet only grabs the first 1,500 characters - both fields are set to a max of 2,000 characters, allowing 500 characters for the remaining JSON data

@jongpie jongpie added Type: Bug Something isn't working Logging Source: Apex Items related to using Logger within Apex Layer: Log Management Items related to the custom objects & Logger Console app labels Sep 2, 2024
@jongpie jongpie changed the title Bugfix: long Apex source snippets now auto-truncated Bugfix: Apex code snippets auto-truncated Sep 2, 2024
@jongpie jongpie temporarily deployed to Base Scratch Org September 2, 2024 19:55 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org September 2, 2024 19:55 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org September 2, 2024 20:01 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org September 2, 2024 20:01 — with GitHub Actions Inactive
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.17%. Comparing base (5c4e09e) to head (3463241).

Files with missing lines Patch % Lines
...re/main/log-management/classes/LogEntryHandler.cls 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
- Coverage   93.18%   93.17%   -0.02%     
==========================================
  Files          67       67              
  Lines        6974     6974              
  Branches      199      199              
==========================================
- Hits         6499     6498       -1     
- Misses        447      448       +1     
  Partials       28       28              
Flag Coverage Δ
Apex 95.46% <80.00%> (-0.02%) ⬇️
LWC 83.26% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jongpie jongpie merged commit ff06c25 into main Sep 3, 2024
1 check passed
@jongpie jongpie deleted the bugfix/truncate-long-source-snippets branch September 3, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Log Management Items related to the custom objects & Logger Console app Logging Source: Apex Items related to using Logger within Apex Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting Error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY when inserting LogEntry records
2 participants