Skip to content

ParseLiveListWidget MongoError #653

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

Closed
tk2232 opened this issue Jul 4, 2021 · 1 comment
Closed

ParseLiveListWidget MongoError #653

tk2232 opened this issue Jul 4, 2021 · 1 comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@tk2232
Copy link

tk2232 commented Jul 4, 2021

I got an MongoError when I use ParseLiveListWidget

LiveQuery is working on the same ParseObject.
I can query the column with result.

I don't know if I've forgotten something or if it's a bug

parse_server_sdk_flutter: ^3.1.0
parse_server: 4.5.0

StackTrace

I/flutter ( 7595): ╭-- Parse Response
I/flutter ( 7595): Class: Activity
I/flutter ( 7595): Function: ParseApiRQ.query
I/flutter ( 7595): Status Code: 1
I/flutter ( 7595): Type: No Results
I/flutter ( 7595): Error: {ok: 0, code: 40352, codeName: Location40352, name: MongoError}
I/flutter ( 7595): ╰-- 
I/flutter ( 7595): 

StackTrace Server

error: Parse error:  MongoError: FieldPath cannot be constructed with empty string {"code":1,"stack":"Error: MongoError: FieldPath cannot be constructed with empty string\n    at ...\\parse-server-4.5.0\\lib\\Controllers\\DatabaseController.js:1170:21\n    at runMicrotasks (<
anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)"}

Page

class HomePage extends StatelessWidget {
  // static const String route = 'home';

  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    QueryBuilder<ParseObject> query =
        QueryBuilder<ParseObject>(ParseObject('Activity'))
          ..whereEqualTo('author', user.state!);

    return SafeArea(
      child: Scaffold(
        body: Center(
          child: Container(
            padding: const EdgeInsets.all(16),
            child: Column(
              children: [
                ElevatedButton(
                  onPressed: () async {
                    ParseResponse res = await query.query();
                    print(res);
                  },
                  child: Text('Get'),
                ),
                SizedBox(
                  height: 500,
                  child: ParseLiveListWidget<ParseObject>(
                    query: query,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Init

    await Parse().initialize(
      'myAppId',
      'http://192.168.178.53:1337/parse',
      liveQueryUrl: 'ws://192.168.178.53:1337/parse',
      clientKey: "lksfjiopj390ue3hfloikh",
      autoSendSessionId: true,
      debug: true,
      // liveListRetryIntervals: [-1],
      parseUserConstructor: (username, password, emailAddress,
              {client, debug, sessionToken}) =>
          User(username, password, emailAddress,
              client: client, debug: debug, sessionToken: sessionToken),
    );

Server

{
  "appId": "myAppId",
  "masterKey": "sfjIFJopnfwoifnpsifhjpwep09324ui9nflknlKNLNl",
  "clientKey": "lksfjiopj390ue3hfloikh",
  "javascriptKey": "lksfjlksjfeopihj",
  "mountGraphQL": true,
  "mountPlayground": true,
  "databaseURI": "mongodb://192.168.178.96",
  "cloud": "./cloud/main.js",
  "allowClientClassCreation": false,
  "liveQuery": {
    "classNames": ["_User", "Activity"]
  },
  "startLiveQueryServer": true,
  "auth": {
    "firebase": {
      "module": "parse-firebase-adapter"
    },
    "google": {}
  }
}
@tk2232
Copy link
Author

tk2232 commented Jul 4, 2021

Ok I've found that there is something wrong with lazyloading.

No issues with lazyloading: false

ParseLiveListWidget<ParseObject>(
                    query: query,
                    lazyLoading: false,
                  ),

RodrigoSMarques added a commit that referenced this issue Sep 14, 2021
@tk2232 tk2232 closed this as completed Sep 14, 2021
@RodrigoSMarques RodrigoSMarques mentioned this issue May 2, 2022
5 tasks
@mtrezza mtrezza reopened this May 30, 2022
@mtrezza mtrezza linked a pull request May 30, 2022 that will close this issue
5 tasks
@mtrezza mtrezza closed this as completed May 30, 2022
@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label May 30, 2022
@mtrezza mtrezza removed a link to a pull request May 30, 2022
5 tasks
RodrigoSMarques pushed a commit to RodrigoSMarques/Parse-SDK-Flutter that referenced this issue May 31, 2022
ParseLiveListWidget is sending the wrong GET request if lazyloading is enabled and no order limiter is set.
We have to check if there is a key to send
RodrigoSMarques added a commit to RodrigoSMarques/Parse-SDK-Flutter that referenced this issue Jun 2, 2022
### Bug Fixes
* Old version of connectivity_plus package ([parse-community#717](parse-community#717))
* package_info_plus not work in web ([parse-community#714](parse-community#714))
* MissingPluginException (No implementation found for method getAll) ([parse-community#712](parse-community#712))
* Query fails for subclassed Parse object in Parse relation ([parse-community#697](parse-community#697))
* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([parse-community#696](parse-community#696))
* Error in progressCallback ([parse-community#679](parse-community#679))
* first: Correct return type ([parse-community#661](parse-community#661))
* ParseLiveListWidget MongoError ([parse-community#653](parse-community#653))

* General improvements
* Updated dependencies
* Fix Label Platform Web Support in pub.dev - Refactor path_provider access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants