Skip to content

v2.28.0#1941

Merged
prafull-opensignlabs merged 1 commit intostagingfrom
updates-17737216200
Sep 15, 2025
Merged

v2.28.0#1941
prafull-opensignlabs merged 1 commit intostagingfrom
updates-17737216200

Conversation

@nxglabs
Copy link
Collaborator

@nxglabs nxglabs commented Sep 15, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 15, 2025 14:51
@vercel
Copy link

vercel bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
open-sign Ready Ready Preview Comment Sep 15, 2025 2:52pm

@prafull-opensignlabs prafull-opensignlabs changed the title Merge pull request #1292 from nxglabs/sync-to-public_repo-17730712175 v2.28.0 Sep 15, 2025
@prafull-opensignlabs prafull-opensignlabs merged commit fe21978 into staging Sep 15, 2025
4 of 5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This appears to be a synchronization merge from a staging branch to the main branch, updating dependencies and implementing various enhancements across the OpenSign application. The changes include package updates, new OTP-based user account deletion functionality, UI improvements, and code refactoring.

  • Package dependency updates across both server and client applications
  • Implementation of OTP-based account deletion system replacing password-based deletion
  • Addition of "Sent Date" column to document reports and various UI enhancements

Reviewed Changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
apps/OpenSignServer/package.json Updates AWS SDK, dotenv, posthog-node, and other dependencies to newer versions
apps/OpenSignServer/cloud/parsefunction/reportsJson.js Adds DocSentAt field to inProgressKeys array for report data
apps/OpenSignServer/cloud/parsefunction/pdf/PDF.js Refactors HTTP requests using shared headers and adds new processPdf function
apps/OpenSignServer/cloud/customRoute/deleteAccount/*.js Implements new OTP-based user deletion system with utilities, handlers, and UI
apps/OpenSign/src/reports/*/**.jsx Adds isSubmit state management and loading indicators to prevent duplicate submissions
apps/OpenSign/src/redux/reducers/widgetSlice.js Adds typedSignFont state management for signature font preferences
apps/OpenSign/src/primitives/RenderReportCell.jsx Adds "Sent Date" column rendering support
apps/OpenSign/src/components/pdf/WidgetsValueModal.jsx Updates font handling to use Redux state for typed signatures
apps/OpenSign/src/components/pdf/PrefillWidgetsModal.jsx Adds submit state handling and removes label hiding logic
apps/OpenSign/package.json Updates serve dependency to latest version
apps/OpenSign/public/locales/*/translation.json Adds new translation keys for UI enhancements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +307 to +315
* @param {Object} _resDoc - Document details (expects AuditTrail, etc.)
* @param {Buffer|Uint8Array} pdfBytes - Original PDF bytes
* @param {string} [options.reason] - Reason text used in placeholder
* @param {string} [options.UserPtr] - user pointer (for audit trail)
* @param {string} [options.ipAddress] - IP (for audit trail)
* @param {string} [options.Signature] - Signature (for audit trail)
* @returns {Promise<Buffer>} merged PDF Buffer
*/
async function processPdf(_resDoc, PdfBuffer, reason) {
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The processPdf function is missing proper JSDoc documentation for the _resDoc parameter, which appears to be unused in the function body. Either document its purpose or remove it if not needed.

Suggested change
* @param {Object} _resDoc - Document details (expects AuditTrail, etc.)
* @param {Buffer|Uint8Array} pdfBytes - Original PDF bytes
* @param {string} [options.reason] - Reason text used in placeholder
* @param {string} [options.UserPtr] - user pointer (for audit trail)
* @param {string} [options.ipAddress] - IP (for audit trail)
* @param {string} [options.Signature] - Signature (for audit trail)
* @returns {Promise<Buffer>} merged PDF Buffer
*/
async function processPdf(_resDoc, PdfBuffer, reason) {
* @param {Buffer|Uint8Array} PdfBuffer - Original PDF bytes
* @param {string} reason - Reason text used in placeholder
* @returns {Promise<Buffer>} merged PDF Buffer
*/
async function processPdf(PdfBuffer, reason) {

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +18
export function generateOtp(len = OTP_LENGTH) {
// 6-digit numeric OTP (000000–999999, padded)
const n = Math.floor(Math.random() * Math.pow(10, len));
return String(n).padStart(len, '0');
}
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The OTP generation uses Math.random() which is not cryptographically secure. Consider using crypto.randomInt() or a cryptographically secure random number generator for better security.

Copilot uses AI. Check for mistakes.
await extUser.save(null, { useMasterKey: true });
return res.json({ ok: true, cooldownSec: RESEND_COOLDOWN_SEC, expiresInMin: OTP_EXPIRES_MIN });
} catch (err) {
console.log('Error sending delete OTP (POST /otp):', err?.response?.data || err);
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

Logging the full error response may expose sensitive information. Consider logging only a sanitized error message or error code.

Suggested change
console.log('Error sending delete OTP (POST /otp):', err?.response?.data || err);
console.log('Error sending delete OTP (POST /otp):', err?.message || 'Unknown error', err?.response?.status ? `Status: ${err.response.status}` : '');

Copilot uses AI. Check for mistakes.
Comment on lines +499 to +501
if (
isCompleted
) {
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

[nitpick] The condition formatting is inconsistent and unnecessarily split across multiple lines for a simple boolean check. Should be: if (isCompleted) {

Suggested change
if (
isCompleted
) {
if (isCompleted) {

Copilot uses AI. Check for mistakes.
Comment on lines +444 to +449
<label
htmlFor={`checkbox-${position.key + ind}`}
className="text-xs mb-0 text-center ml-[3px] cursor-pointer"
>
{data}
</label>
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The removal of the isHideLabel condition check means labels will always be shown now. If this is intentional, consider adding a comment explaining why this logic was simplified.

Copilot uses AI. Check for mistakes.
Comment on lines +632 to +633
const selectedFont = typedSignFont || fontSelect;
await document.fonts.load(`20px ${selectedFont}`);
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The font loading error handling should provide more specific error information. Consider catching and logging the specific font name that failed to load.

Copilot uses AI. Check for mistakes.
class: "contracts_Document",
query:
'where={"Type":null,"Signers":{"#*exists":true},"Placeholders":{"#*exists":true},"SignedUrl":{"#*exists":true},"IsCompleted":false,"IsDeclined":false,"IsArchive":null,"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&keys=Name,ExpiryDate,SignedUrl,Signers&count=1',
'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true},"Placeholders":{"#*exists":true},"SignedUrl":{"#*exists":true},"IsCompleted":{"#*ne":true},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1&limit=0',
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

[nitpick] This query string is extremely long and hard to read. Consider breaking it into multiple lines or using a query builder pattern for better maintainability.

Suggested change
'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true},"Placeholders":{"#*exists":true},"SignedUrl":{"#*exists":true},"IsCompleted":{"#*ne":true},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1&limit=0',
`where={
"Type":{"#*ne":"Folder"},
"Signers":{"#*exists":true},
"Placeholders":{"#*exists":true},
"SignedUrl":{"#*exists":true},
"IsCompleted":{"#*ne":true},
"IsDeclined":{"#*ne":true},
"IsArchive":{"#*ne":true},
"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},
"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}
}&count=1&limit=0`,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants