Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12207] CLI: Enforce lower-case app IDs

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2013-02-12T19:38:40.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 02 JS, 2013 Sprint 02
ComponentsCLI
LabelsSupportTeam, js
ReporterEduardo Gomez
AssigneeChris Barber
Created2013-01-04T11:03:17.000+0000
Updated2017-03-22T17:56:23.000+0000

Description

Feature Request

This feature is to add *lower case* message in our logs as follows:
logger.error(__('Invalid app id "%s"', cli.argv.id) + '\n');
logger.log(__('The app id must consist of letters, numbers, and underscores.'));
logger.log(__('The first character must be a letter or underscore.'));
logger.log(__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)") + '\n');
Suggest is just adding "lower case":
logger.error(__('Invalid app id "%s"', cli.argv.id) + '\n');
logger.log(__('The app id must consist of lower case letters, numbers, and underscores.'));
logger.log(__('The first character must be a letter or underscore.'));
logger.log(__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)") + '\n');
- [Source code](https://github.com/cb1kenobi/titanium_mobile/commit/55c150d112bc944333072c080700ecaf925c916a#L0R156)

Customer remarks

{quote} "I have no particular reason to have mixed case other than aesthetics. We had just blindly created one with mixed case. It wasn't a problem until I tried a CI sdk and suddenly our app id was invalid, and I had to dig into the code to find out why, lower case is not mentioned as a requirement in the error. We are just now getting to the release phase of the iphone version of our app, so maybe we would have run into problems down the road. So I'd suggest to specify in the error that lower case is required. It'll probably help others." {quote}

Comments

  1. Steve Trautman 2013-01-04

    The same error message in in there twice at lines 67 and 141 of: titanium_mobile / support / cli / commands / create.js
  2. Chris Barber 2013-01-14

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3705 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3706
  3. Eric Merriman 2013-02-10

    Either I am crazy, or I am not seeing these fixes in either 3.1.0.v20130210021015 or 3.0.2.v20130207164659. From create.js:
       						// general app id validation
       						if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\.[a-zA-Z0-9_]*)*)$/.test(id)) {
       							throw new appc.exception(__('Invalid app id "%s"', id), [
       								__('The app id must consist of letters, numbers, and underscores.'),
       								__('The first character must be a letter or underscore.'),
       								__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)")
       							]);
       						}
       
       	// general app id validation
       	if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\.[a-zA-Z0-9_]*)*)$/.test(cli.argv.id)) {
       		logger.error(__('Invalid app id "%s"', cli.argv.id) + '\n');
       		logger.log(__('The app id must consist of letters, numbers, and underscores.'));
       		logger.log(__('The first character must be a letter or underscore.'));
       		logger.log(__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)") + '\n');
       		process.exit(1);
       	}
       
    Both builds have the same content, no "lower case" And from: ~/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.v20130207164659/node_modules/titanium-sdk/lib/titanium.js:
       exports.validateTiappXml = function (logger, tiapp) {
       	if (!tiapp.id) {
       		logger.error(__('tiapp.xml is missing the <id> element') + '\n');
       		logger.log(__('The app id must consist of letters, numbers, and underscores.'));
       		logger.log(__('The first character must be a letter or underscore.'));
       		logger.log(__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)") + '\n');
       		process.exit(1);
       	}
       	
       	if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\.[a-zA-Z0-9_]*)*)$/.test(tiapp.id)) {
       		logger.error(__('tiapp.xml contains an invalid app id "%s"', tiapp.id) + '\n');
       		logger.log(__('The app id must consist of letters, numbers, and underscores.'));
       		logger.log(__('The first character must be a letter or underscore.'));
       		logger.log(__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)") + '\n');
       		process.exit(1);
       	}
       
    Also no "lower case".
  4. Chris Barber 2013-02-10

    @Eric, at one point in time, we mandated that you could only use lower case letters, but that caused issues, so now we allow lower case letters, hence why "lower case" is no longer printed in the error message. We now have more relaxed app id validation when the app is created and strict app id validation when building for Android. Android is the only platform with strict app id validation.
  5. Ingo Muschenetz 2013-02-12

    We decided that lower-case IDs are no longer mandatory.
  6. Christian Dietrich 2013-03-19

    @Ingo, please can you also allow the "-" as valid character in the Application Id as it was until 3.0.0.GA (for IOS)? My Application ID of my app looks like "de.company.abc-def-ghi" and is already available in the app store. Otherwise I can't use newer versions than 3.0.0.GA if I want update my app (if I change the application id the provisioning file gets invalid, etc.).
  7. Lee Morris 2017-03-22

    Closing ticket as the issue will not fix and with reference to the above comments.

JSON Source