Skip to content

fix: private attributes not being accessible in dart #1115

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

Merged
merged 1 commit into from
Jul 21, 2025

Conversation

ChiragAgg5k
Copy link
Member

What does this PR do?

fixes environment variables like _APP_DOMAIN_SITES being marked as private and hence the model not working at all.

Test Plan

updated dart tests, eg:

import 'package:dart_appwrite/models.dart';
import 'package:test/test.dart';

void main() {
  group('ConsoleVariables', () {

    test('model', () {
      final model = ConsoleVariables(
        APP_DOMAIN_TARGET_CNAME: 'appwrite.io',
        APP_DOMAIN_TARGET_A: '127.0.0.1',
        APP_DOMAIN_TARGET_AAAA: '::1',
        APP_STORAGE_LIMIT: 30000000,
        APP_COMPUTE_SIZE_LIMIT: 30000000,
        APP_USAGE_STATS: 'enabled',
        APP_VCS_ENABLED: true,
        APP_DOMAIN_ENABLED: true,
        APP_ASSISTANT_ENABLED: true,
        APP_DOMAIN_SITES: 'sites.localhost',
        APP_DOMAIN_FUNCTIONS: 'functions.localhost',
        APP_OPTIONS_FORCE_HTTPS: 'enabled',
        APP_DOMAINS_NAMESERVERS: 'ns1.example.com,ns2.example.com',
      );

      final map = model.toMap();
      final result = ConsoleVariables.fromMap(map);

      expect(result.APP_DOMAIN_TARGET_CNAME, 'appwrite.io');
      expect(result.APP_DOMAIN_TARGET_A, '127.0.0.1');
      expect(result.APP_DOMAIN_TARGET_AAAA, '::1');
      expect(result.APP_STORAGE_LIMIT, 30000000);
      expect(result.APP_COMPUTE_SIZE_LIMIT, 30000000);
      expect(result.APP_USAGE_STATS, 'enabled');
      expect(result.APP_VCS_ENABLED, true);
      expect(result.APP_DOMAIN_ENABLED, true);
      expect(result.APP_ASSISTANT_ENABLED, true);
      expect(result.APP_DOMAIN_SITES, 'sites.localhost');
      expect(result.APP_DOMAIN_FUNCTIONS, 'functions.localhost');
      expect(result.APP_OPTIONS_FORCE_HTTPS, 'enabled');
      expect(result.APP_DOMAINS_NAMESERVERS, 'ns1.example.com,ns2.example.com');
    });
  });
}

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes.

@ChiragAgg5k ChiragAgg5k merged commit 7e23df1 into feat-dart-generics Jul 21, 2025
38 checks passed
@lohanidamodar lohanidamodar deleted the fix-private-attributes branch July 21, 2025 05:25
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.

2 participants