Skip to content

Commit b5dd436

Browse files
CodingAnarchyclaude
andcommitted
fix: Database queue encryption field compilation without encryption feature v1.8.3
- Fixed PostgreSQL and MySQL queue implementations to use feature-gated encryption fields - Added #[cfg(feature = "encryption")] guards around encryption_config, retention_policy, and encrypted_payload field assignments in Job struct creation - Resolved compilation errors when using Hammerwork without the encryption feature in client applications - Ensures Job struct creation works correctly in all database queue operations regardless of feature flags - Tested compilation with postgres, mysql, and no database features - all pass - All 262 unit tests passing, 20 encryption tests passing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6a5c30d commit b5dd436

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.8.3] - 2025-07-12
9+
10+
### Fixed
11+
- **🔐 Database Queue Compilation**
12+
- Fixed PostgreSQL and MySQL queue implementations to use feature-gated encryption fields
13+
- Added `#[cfg(feature = "encryption")]` guards around `encryption_config`, `retention_policy`, and `encrypted_payload` field assignments
14+
- Resolved compilation errors when using Hammerwork without the encryption feature in client applications
15+
- Ensures Job struct creation works correctly in all database queue operations regardless of feature flags
16+
817
## [1.8.2] - 2025-07-12
918

1019
### Fixed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
resolver = "2"
1010

1111
[workspace.package]
12-
version = "1.8.2"
12+
version = "1.8.3"
1313
edition = "2024"
1414
license = "MIT"
1515
repository = "https://github.com/CodingAnarchy/hammerwork"

src/queue/mysql.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ impl JobRow {
124124
correlation_id: self.correlation_id,
125125
parent_span_id: self.parent_span_id,
126126
span_context: self.span_context,
127+
#[cfg(feature = "encryption")]
127128
encryption_config: None,
128129
pii_fields: Vec::new(),
130+
#[cfg(feature = "encryption")]
129131
retention_policy: None,
130132
is_encrypted: false,
133+
#[cfg(feature = "encryption")]
131134
encrypted_payload: None,
132135
})
133136
}
@@ -191,10 +194,13 @@ impl DeadJobRow {
191194
correlation_id: None,
192195
parent_span_id: None,
193196
span_context: None,
197+
#[cfg(feature = "encryption")]
194198
encryption_config: None,
195199
pii_fields: Vec::new(),
200+
#[cfg(feature = "encryption")]
196201
retention_policy: None,
197202
is_encrypted: false,
203+
#[cfg(feature = "encryption")]
198204
encrypted_payload: None,
199205
})
200206
}
@@ -1498,10 +1504,13 @@ impl DatabaseQueue for crate::queue::JobQueue<MySql> {
14981504
correlation_id: archived_row.get("correlation_id"),
14991505
parent_span_id: archived_row.get("parent_span_id"),
15001506
span_context: archived_row.get("span_context"),
1507+
#[cfg(feature = "encryption")]
15011508
encryption_config: None,
15021509
pii_fields: Vec::new(),
1510+
#[cfg(feature = "encryption")]
15031511
retention_policy: None,
15041512
is_encrypted: false,
1513+
#[cfg(feature = "encryption")]
15051514
encrypted_payload: None,
15061515
};
15071516

src/queue/postgres.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ impl JobRow {
112112
correlation_id: self.correlation_id,
113113
parent_span_id: self.parent_span_id,
114114
span_context: self.span_context,
115+
#[cfg(feature = "encryption")]
115116
encryption_config: None, // TODO: Implement encryption config deserialization
116-
pii_fields: Vec::new(), // TODO: Implement PII fields deserialization
117-
retention_policy: None, // TODO: Implement retention policy deserialization
118-
is_encrypted: false, // TODO: Implement encryption status from database
117+
pii_fields: Vec::new(), // TODO: Implement PII fields deserialization
118+
#[cfg(feature = "encryption")]
119+
retention_policy: None, // TODO: Implement retention policy deserialization
120+
is_encrypted: false, // TODO: Implement encryption status from database
121+
#[cfg(feature = "encryption")]
119122
encrypted_payload: None, // TODO: Implement encrypted payload deserialization
120123
})
121124
}
@@ -179,10 +182,13 @@ impl DeadJobRow {
179182
correlation_id: None,
180183
parent_span_id: None,
181184
span_context: None,
185+
#[cfg(feature = "encryption")]
182186
encryption_config: None,
183187
pii_fields: Vec::new(),
188+
#[cfg(feature = "encryption")]
184189
retention_policy: None,
185190
is_encrypted: false,
191+
#[cfg(feature = "encryption")]
186192
encrypted_payload: None,
187193
}
188194
}
@@ -360,10 +366,13 @@ impl DatabaseQueue for crate::queue::JobQueue<Postgres> {
360366
correlation_id,
361367
parent_span_id,
362368
span_context,
369+
#[cfg(feature = "encryption")]
363370
encryption_config: None,
364371
pii_fields: Vec::new(),
372+
#[cfg(feature = "encryption")]
365373
retention_policy: None,
366374
is_encrypted: false,
375+
#[cfg(feature = "encryption")]
367376
encrypted_payload: None,
368377
}))
369378
} else {
@@ -518,10 +527,13 @@ impl DatabaseQueue for crate::queue::JobQueue<Postgres> {
518527
correlation_id: None,
519528
parent_span_id: None,
520529
span_context: None,
530+
#[cfg(feature = "encryption")]
521531
encryption_config: None,
522532
pii_fields: Vec::new(),
533+
#[cfg(feature = "encryption")]
523534
retention_policy: None,
524535
is_encrypted: false,
536+
#[cfg(feature = "encryption")]
525537
encrypted_payload: None,
526538
}));
527539
}
@@ -1675,10 +1687,13 @@ impl DatabaseQueue for crate::queue::JobQueue<Postgres> {
16751687
correlation_id: archived_row.get("correlation_id"),
16761688
parent_span_id: archived_row.get("parent_span_id"),
16771689
span_context: archived_row.get("span_context"),
1690+
#[cfg(feature = "encryption")]
16781691
encryption_config: None,
16791692
pii_fields: Vec::new(),
1693+
#[cfg(feature = "encryption")]
16801694
retention_policy: None,
16811695
is_encrypted: false,
1696+
#[cfg(feature = "encryption")]
16821697
encrypted_payload: None,
16831698
};
16841699

0 commit comments

Comments
 (0)