Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1da710e
Make recCache dictionary thread safe
rugoncalves Feb 19, 2026
f6b791d
Removing unneeded dependencies
rugoncalves Feb 19, 2026
531f995
Improving code performance
rugoncalves Feb 19, 2026
53f2c7f
Project context
rugoncalves Feb 19, 2026
7992c45
Missing namespace
rugoncalves Feb 19, 2026
165e271
Update version of dotnet
rugoncalves Feb 19, 2026
aea00d3
Fix method name
rugoncalves Feb 19, 2026
f56ecfd
Fixing implementation errors
rugoncalves Feb 19, 2026
28d4546
Re-adding namespace
rugoncalves Feb 19, 2026
fb84818
auto added namspaces
rugoncalves Feb 19, 2026
f67c766
Update .gitignore
rugoncalves Feb 19, 2026
3636b99
Auto updated template
rugoncalves Feb 19, 2026
a0fad12
Update .gitignore
rugoncalves Feb 19, 2026
25bc4a2
Update version
rugoncalves Feb 19, 2026
2a36a62
Update OutSystems.NssDataGridUtils.xml
rugoncalves Feb 19, 2026
653ad12
Update DataGridUtils.xif
rugoncalves Feb 19, 2026
b668fde
Making code more robust
rugoncalves Feb 19, 2026
99c5fc1
Update DataGridUtils.xif
rugoncalves Feb 19, 2026
33c41c4
Update .cursor/rules/project-context.mdc
rugoncalves Feb 19, 2026
3c79189
Fix a bug that caused the metadata be empty
rugoncalves Feb 24, 2026
063ed33
Changing check for field
rugoncalves Feb 24, 2026
b8a4ae1
Removing files from git
rugoncalves Feb 24, 2026
7db87ca
Adding unit test project
rugoncalves Feb 24, 2026
7e8b30a
Change extension to latest version
rugoncalves Feb 24, 2026
8a36b22
Update .gitignore
rugoncalves Feb 24, 2026
502555d
Update project information
rugoncalves Feb 24, 2026
dc2e12f
Updating comment for clear understanding
rugoncalves Feb 24, 2026
ff1e4d2
Adding ADR folder
rugoncalves Feb 24, 2026
455c1ca
Adding ADR for the changes made
rugoncalves Feb 24, 2026
98b9205
Improving test names
rugoncalves Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .cursor/rules/project-context.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
description: Project context for the OutSystems DataGrid extension (.NET server-side code)
globs: extension/**/*.cs
alwaysApply: false
---

# DataGridUtils .NET Extension

OutSystems Integration Studio extension (assembly `OutSystems.NssDataGridUtils`) that converts OutSystems platform objects (entities, structures, records, lists) into JSON for the front-end Data Grid component.

## Directory Layout

- `extension/DataGridUtils/Templates/NET/` — Auto-generated stubs from Integration Studio (do not edit).
- `extension/DataGridUtils/Source/NET/` — Actual implementation (edit here).
- `extension/tests/` — Standalone test project (`DataGridUtils.Tests.csproj`).

## Key Files (under `Source/NET/`)

| File | Role |
|---|---|
| `Interface.cs` | `IssDataGridUtils` — public API with `MssConvertData2JSON` and deprecated `MssConvertData2JSON_deprecated` |
| `DataGridUtils.cs` | `CssDataGridUtils` — implementation; bundles data + metadata into `{"data": ..., "metadata": ...}` |
| `ObtainMetadata.cs` | Reflection-based schema extractor; walks fields/properties prefixed with `ss` to produce a JSON type map |
| `temp_ardoJSON.cs` | Forked `ardoJSON` serializer; reflection + caching (`recCache`), smart ISO 8601 dates, list flattening, `Byte[]` exclusion |
| `Structures.cs`, `Records.cs`, `RecordLists.cs`, `Entities.cs` | Empty namespace placeholders from Integration Studio |

## Test Project (`extension/tests/`)

A .NET Framework 4.7.2 console app that tests the extension without the OutSystems platform.

| File | Role |
|---|---|
| `DataGridUtils.Tests.csproj` | Project file; references the compiled extension DLL and platform DLLs from `Source/NET/Bin/` |
| `ConvertData2JSONTests.cs` | Tests for `MssConvertData2JSON`; contains mock OutSystems types (`ISimpleRecord`, `IRecord`, `IOSList`) and a lightweight pass/fail console runner |

- **Mock types** — `STCenasListStructure`, `RCCenasListRecord`, `RLCenasListRecordList` replicate the OutSystems record-list hierarchy so `CssDataGridUtils` can be exercised in isolation.
- **Runner pattern** — `RunTest(name, Action)` catches exceptions; `AssertEqual` provides positional diff on failure. Exit code 1 on any failure.

## Conventions

- OutSystems runtime objects prefix fields/properties with `ss` (simple), `ssEN` (entity), `ssST` (structure). The code strips these prefixes when writing JSON keys.
- `Byte[]` fields are excluded from both data and metadata (ticket RGRIDT-364).
- DateTime handling (format `3` — smart ISO 8601): `1900-01-01 00:00:00` → `""`, date-only → `yyyy-MM-dd`, time-only → `HH:mm:ss`, full → UTC `yyyy-MM-dd'T'HH:mm:ssZ`.

## Dependencies

- .NET Framework 4.7.2
- Newtonsoft.Json 6.0 (from OutSystems Dev Environment)
- OutSystems.HubEdition.RuntimePlatform (`IRecord`, `ISimpleRecord`, `IOSList`)
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ new-version-artf.txt

# Distribution files folder
dist/**

# Extension compiled files
/**/Bin/**
/**/obj/**

# Ignoring .vs folder
/**/.vs/**

# Ignoring DataGridUtils backups
/extension/DataGridUtils/Backups/**
46 changes: 46 additions & 0 deletions docs/adr/ADR-0000-Title-of-ADR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!-- This is an ADR template, follow the same convention for future ADRs -->

# ADR-0000: Title of ADR

## Status

Proposed/Accepted/Rejected/Superseded by ADR-XXXX

## Context

What is the issue that we're seeing that is motivating this decision or change?
What is the current architectural state relevant to this decision?
What are the constraints (technical, business, etc.)?

## Decision Drivers

- Driver 1
- Driver 2
- ...

## Considered Options

- Option 1
- Pros:
- Cons:
- Option 2
- Pros:
- Cons:
- ...

## Decision Outcome

Chosen option: "Option X", because [justification. e.g., only option that meets k.o. criteria decision driver | satisfies critical requirement | ... | comes out best (see below)].
Positive consequences:

- ...
Negative consequences:
- ...

## Links

- Link to related issues, discussions, or documents.

## Date

YYYY-MM-DD
52 changes: 52 additions & 0 deletions docs/adr/ADR-0001-Extension-Dotnet-Upgrade-And-Improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# ADR-0001: Extension .NET Upgrade and Improvements

## Status

Accepted

## Context

The DataGridUtils extension (`OutSystems.NssDataGridUtils`) was targeting an older .NET Framework version. The reflection-based JSON serializer (`temp_ardoJSON`) used a non-thread-safe `Dictionary<Type, ...>` for its type cache (`recCache`), which could cause thread deadlocks under concurrent access on the OutSystems platform. Additionally, the extension had no automated tests, making it difficult to validate changes without deploying to the platform.

## Decision Drivers

- The OutSystems platform runtime uses .NET Framework 4.7.2, so updating from the outdated and unsupported 4.6.1 can be done safely.
- The `recCache` static dictionary was susceptible to deadlocks when accessed concurrently by multiple threads handling parallel requests, potentially causing data corruption and high usage of CPU - but the occurence of this is minimal.
- There was no way to test the extension logic in isolation without the OutSystems platform, slowing down development and increasing the risk of regressions.

## Considered Options

- Option 1: Upgrade .NET version only
- Pros: Minimal change, low risk.
- Cons: Does not address thread safety or testability.
- Option 2: Upgrade .NET version + fix thread safety + add test project
- Pros: Addresses all the concerns of the RPM-6484.
- Cons: Larger changeset, but changes are isolated to the extension layer.
- Option 3: Upgrade .NET version + fix thread safety + add test project
- Pros: Addresses all three concerns in a single effort; the test project enables validating the thread-safety fix and future changes without the platform.
- Cons: Larger changeset, but changes are isolated to the extension layer.

## Decision Outcome

Chosen option: "Option 3", because it addresses all identified issues together, and the test project provides confidence that the thread-safety and serialization fixes work correctly.

Positive consequences:

- Extension now targets .NET Framework 4.7.2, aligning with the OutSystems platform runtime.
- Replaced `Dictionary<Type, Dictionary<string, FieldHolder>>` with `ConcurrentDictionary` in `temp_ardoJSON.recCache`, eliminating the thread deadlock risk during concurrent serialization calls.
- A standalone .NET Framework 4.7.2 test project (`extension/tests/DataGridUtils.Tests.csproj`) enables testing `MssConvertData2JSON` in isolation using mock OutSystems types (`ISimpleRecord`, `IRecord`, `IOSList`), without requiring the OutSystems platform.

Negative consequences:

- The test project references compiled DLLs from the extension's `Bin/` directory, so tests must be run after building the extension.

## Links

- `extension/DataGridUtils/Source/NET/DataGridUtils.csproj` — updated target framework.
- `extension/DataGridUtils/Source/NET/temp_ardoJSON.cs` — `ConcurrentDictionary` change.
- `extension/tests/DataGridUtils.Tests.csproj` — new test project.
- `extension/tests/ConvertData2JSONTests.cs` — test implementation with mock types.

## Date

2026-02-24
30 changes: 30 additions & 0 deletions docs/adr/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Architecture Decision Records (ADRs)

This directory contains Architecture Decision Records (ADRs) for this project.
ADRs are short documents that capture important architectural decisions, along with their context and consequences.

## Purpose

- To document significant architectural decisions.
- To provide context for why decisions were made.
- To help onboard new team members.
- To facilitate future architectural discussions and evolution.
- To provide context to AI-powered development assistants.

## Format

Each ADR should follow the template in `ADR-0000-Title-of-ADR.md`.

## Process

1. **Propose:** Copy `ADR-0000-Title-of-ADR.md` to a new file named `NNNN-title-of-adr.md`, where `NNNN` is the next sequential number and the rest is a dash-separated, lowercase version of the title.
2. **Discuss:** Fill out the ADR and discuss it with the team.
3. **Decide:** Once a decision is reached, update the status in the ADR (e.g., "Accepted", "Rejected", "Superseded").
4. **Commit:** Commit the ADR to the repository.

## ADR Log

| ADR Number | Title | Status | Date |
| :--------- | :---------------------------------------------------------------- | :------- | :---------------------------------- |
| ADR-0000 | Template for ADRs | Meta | 2026-02-04 |
| ADR-0001 | Extension .NET Upgrade and Improvements | Accepted | 2026-02-24 |
Binary file modified extension/DataGridUtils.xif
Binary file not shown.
4 changes: 2 additions & 2 deletions extension/DataGridUtils/Source/NET/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
[assembly: ComVisible(false)]
[assembly: CLSCompliantAttribute(false)]

[assembly: AssemblyVersion("11.14.0.33133")]
[assembly: AssemblyFileVersion("11.14.0.33133")]
[assembly: AssemblyVersion("11.40.1.46624")]
[assembly: AssemblyFileVersion("11.40.1.46624")]

[assembly: NeutralResourcesLanguage("")]

Binary file not shown.
Binary file not shown.
Loading