Parse-SDK-JS icon indicating copy to clipboard operation
Parse-SDK-JS copied to clipboard

Query only works after any update on Dashboard

Open andresteves opened this issue 2 years ago • 11 comments

New Issue Checklist

Issue Description

So I have setup my Parse Server(5.2.0) and Dashboard(4.1.0) and I am using the JS SDK latest version to build a React Native app with Parse integration but queries respond with ParseError: 119 This user is not allowed to access non-existent class: Task. But Task class exists and if I update any field then the query works fine. Any ideas?

Steps to reproduce

Basic query responds with ParseError: 119 This user is not allowed to access non-existent class: Task. Task class exists

Actual Outcome

ParseError: 119 This user is not allowed to access non-existent class: Task.

Expected Outcome

Class Tasks values

Environment

Server

  • Parse Server version: 5.2.0
  • Operating system: Debian GNU/Linux 10 (buster)
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): remote server

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: db version v5.0.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): remote server

Client

  • Parse JS SDK version: 4.1.0

Logs

andresteves avatar Aug 22 '23 14:08 andresteves

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

Have you checked your class level permission in the dashboard?

dplewis avatar Aug 22 '23 21:08 dplewis

Class level permission is public read / write.

andresteves avatar Aug 23 '23 09:08 andresteves

In your Parse Server Configuration do you have allowClientClassCreation turned off?

dplewis avatar Aug 23 '23 17:08 dplewis

@dplewis Yes I have it off.

andresteves avatar Aug 23 '23 17:08 andresteves

Turning it on should fix your issue. See here

dplewis avatar Aug 23 '23 17:08 dplewis

@dplewis but I want to read only from app side. Would that not enable classes to be editable and even created on client side?

andresteves avatar Aug 23 '23 18:08 andresteves

Can you update to the latest version of Parse Server?

dplewis avatar Aug 23 '23 18:08 dplewis

@dplewis I know this might be a dumb question but is there any problem on updating the version directly (meaning do I need to do a backup or anything) ?

andre-sonect avatar Aug 25 '23 10:08 andre-sonect

Depends on the changes from 5.XX to 6.XX may have some breaking changes.

dplewis avatar Aug 25 '23 17:08 dplewis

@dplewis does parse-server sleeps for some reason because I am trying the same now on a backoffice and it does login fine but then when trying to fetch a pointer inside _User class, it returns undefined.

try {
		await Parse.User.logOut();
		var usr = await Parse.User.logIn(req.body.email, req.body.password);
		usr = Parse.User.current();
		var query = new Parse.Query('Client');
		var client = await query.get(usr.get('clientId').id);     <-------- get('client').id returns undefined ----
		var flags = client.get('flags');
		
		if (flags.includes('****')) {
			res.redirect('/contents/welcome')
		}  else {
			res.redirect('/app/about')
		}
	} catch (error) {
		res.render('index', { error: 'Invalid username/password: ' + error })
	}

andre-sonect avatar Oct 07 '23 10:10 andre-sonect